I have IIS enabled (fresh "install") and a port configured XAMPP install with a fresh Wordpress build.
httpd.conf (changes):
Listen 8080
ServerName localhost:8080
httpd-ssl.conf (changes):
Listen 4433
<VirtualHost _default_:4433>
ServerName www.example.com:4433
httpd-vhosts.conf (changes):
NameVirtualHost *:8080
<VirtualHost *:8080>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot "C:/xampp/htdocs/foobar"
ServerName foo.bar
<Directory "C:/xampp/htdocs/foobar">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
hosts (changes):
127.0.0.1 localhost
127.0.0.1 foo.bar
Tests:
http://localhost/
IIS Root (expected)
http://localhost:8080/[dashboard]
XAMPP Root (expected)
http://localhost:8080/foobar
resolves to http://localhost/foobar, displays IIS error page (incorrect, should show the Wordpress install)
http://foo.bar
displays IIS root (incorrect, should show Wordpress install)
http://foo.bar:8080
resolves to http://foo.bar (same result as above)
Honestly, at this point I have no idea what I have setup that is incorrect. I've spent all day reading forums and SO, and I'm not making any headway. Help? Am I making incorrect assumptions on behavior or do I have a mistake in my setup?
Assuming that you want both services running at the same time, that you'll mostly be working with XAMPP. This is my solution:
I'm not a fan of typing in port 8080 whenever I want to be working with XAMPP. So I just changed the post number of IIS to 82.
Start IIS (7) On the left go to YOUR MACHINE > Sites > Default Web Site
Then on the right click on bindings then a window pops up
Click on the first row and edit the port number to anyting but 80 (because 80 is the default port if you don't type in anything in
your browser)
Reset all the settings of httpd.conf, httpd-ssl.conf
Then open httpd-vhosts.conf and put this:
<VirtualHost *:80>
DocumentRoot C:\xampp\htdocs\foobar
ServerName foo.bar
</VirtualHost>
Restart your computer (httpd-vhosts.conf doesn't take effect without)
The file hosts is fine as it is.
Related
I have installed MAMP (free version) on my Mac and I see the Start Page but I have a problem:
I deployed wordpress but browser say unable to connect (basically I cannot see wordpress page in browser).
In Document Root if I put a static html file I am able to see it in the browser. I am also able to see wordpress administrative pages and all other pages but home page. I have 8888 and 8889 for php and mysql ports. I do not know how to debug the issues. php, apache and mysql do not report any particular problems.
I configured virtual hosts following this guide:
http://foundationphp.com/tutorials/vhosts_mamp.php
The strange thing when I put http://localhost:8888/mywebsite in the browser it is redirected to localhost/mywebsite.
In /etc/hosts I have:
127.0.0.1 localhost
In httpd.conf I activated:
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
and in this file I have:
NameVirtualHost *:8888
<VirtualHost *:8888>
ServerAdmin myuser#gmail.com
DocumentRoot "/Applications/MAMP/htdocs"
ServerName localhost
ErrorLog "logs/mywebsite-error_log"
CustomLog "logs/mywebsite-access_log" common
</VirtualHost>
Hope someone could help.
I found the solution. After several debugging I found that this guide is correct: http://foundationphp.com/tutorials/vhosts_mamp.php
You need: 1. In /etc/hosts add your virtual hosts like:
127.0.0.1 localhost
127.0.0.1 mywebsite
before I only used localhost because I hoped to use this host in browser but I found it's required to define a new host like mywebsite.
In httpd.conf I activated:
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
In this file I have:
ServerAdmin myuser#gmail.com
DocumentRoot "/Applications/MAMP/htdocs"
ServerName mywebsite
ErrorLog "logs/mywebsite-error_log"
CustomLog "logs/mywebsite-access_log" common
I'm setting up WP Network on my localhost. I'm on windows, using Uniform Server, and I've setup a vhost like this:
<VirtualHost *:${AP_PORT}>
ServerAdmin webmaster#themes.wp
DocumentRoot ${US_ROOTF}/vhosts/themeswp
ServerName themes.wp
ServerAlias www.themes.wp *.themes.wp
ErrorLog logs/themes.wp-error.log
CustomLog logs/themes.wp-access.log common
<Directory "${HOME}\vhosts\themeswp">
Options Indexes Includes
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
plus I've added this on the windows Host:
127.0.0.1 themes.wp
If I go to
themes.wp
everything loads fine. If I try a third level domain, like
dummy.themes.wp
I get
ERR_NAME_NOT_RESOLVED
Wordpress Network tells me this:
Warning! Wildcard DNS may not be configured correctly!
The installer attempted to contact a random hostname (9f3c9c.themes.wp) on your domain.
This resulted in an error message: cURL error 6: Could not resolve host: 9f3c9c.themes.wp
Right, themes.wp and dummy.themes.wp different domains
Fast way: add dummy.themes.wp to you hosts file
127.0.0.1 dummy.themes.wp
Or install any simple dns server because hosts not support wildcard domains
I installed XAMPP on my windows server and also installed Wordpress XAMPP module. I also bought a domain to point it to my server ip. Thing is , I want that when people enter mydomain.com , mydomain.com shows in the address bar and that it keeps showing while browsing.
First I tried to point the domain to my ip , and when I go to mydomain.com it shows mydomain.com/xampp
Then I tried to changing:DocumentRoot "C:\xampp\htdocs"
<Directory "C:\xampp\htdocs">
in httpd file in C:\xampp\apache\conf
to
DocumentRoot "C:\xampp\apps\wordpress\htdocs"
<Directory "C:\xampp\apps\wordpress\htdocs">
But this time when I enter mydomain.com it redirects to myipaddress.com/wordpress
All I want is:
1)When someone enters mydomain.com , he will see my wordpress home page.
2)Whenever a user is browsing mydomain.com , he will always see mydomain instead of myipaddress.
Any help would be appreciated.
Regards!
Type this at the bottom of your httpd file:
Alias /wordpress "C:/xampp/htdocs/wordpress/"
<Directory "C:/xampp/htdocs/wordpress/">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Please take note that the directory that I stated above is a sample of a default directory. I am having a hard time trying to figure out your directory but the above example should make sense. After typing the codes on your httpd file, go to the directory of xamp/apache/conf/extra/ and openup the httpd-vhosts file. Type this at the bottom of the httpd-vhosts file:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.yourdomain.com
ServerAlias yourdomain.com
ServerAdmin email#yourdomain.com
DocumentRoot "C:\xampp\htdocs\wordpress"
</VirtualHost>
Double check your host file if you already entered this line:
127.0.0.1 yourdomain.com
Restart your Apache webserver. Hope this helps!
I have a wordpress blog in AWS that uses http.
Now I instaled a SSL certificate so I can use https.
All http://www.mysite.com works fine. All content loads and is perfect.
When I use https://www.mysite.com, all assets (images, css, js,..) are not loaded and got a console error that the server can't find in https.
Does anyone know a possible solution for this?
Installed mod_sll, restarted Apache, update yum, open port 443.... But nothing.
Thanks in advance
Seems like you didn't properly setup the SSL virtual host. if you use default ssl.conf in apache, make sure you add ServerName and ServerAlias accordingly.
If it still didn't work. Please backup your ssl.conf first and delete all the lines below
## SSL Virtual Host Context in ssl.conf and put following content in ssl.conf or as a new file in sites-enabled if you're using debian based.
Also dont forget to run netstat -nltp and see if port 443 is listing by apache. If not add listen 443 in your httpd.conf or ssl.conf
<VirtualHost *:443>
SSLEngine on
SSLProtocol -ALL +SSLv3 +TLSv1
SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:!LOW:!SSLv2:!EXPORT
## /etc/httpd/ssl/ replace with the directory which contains your PrivateKey,
## Certificate and Bundle file(if available)
SSLCertificateFile /etc/httpd/ssl/ssl.crt/your_domain.crt
SSLCertificateKeyFile /etc/httpd/ssl/ssl.key/your_domain.key
SSLCACertificateFile /etc/httpd/ssl/ssl.crt/bundle.crt
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ServerAdmin youremail.com
DocumentRoot /var/www/yourdomain.com/htdocs
php_admin_value open_basedir "/var/www/yourdomain.com/htdocs"
<Directory "/var/www/yourdomain.com/htdocs" >
Options -Indexes FollowSymLinks
allow from all
AllowOverride All
</Directory>
CustomLog /var/log/httpd/yourdomain-access_log combined
ErrorLog /var/log/httpd/yourdomain-error_log
</VirtualHost>
I have installed XAMPP and edited the httpd.conf file because my port 80 is busy.
So I have the following:
Listen 0.0.0.0:8888
Servername localhost:8888
Everything works fine until I try to install WordPress 3.0.5 MS because it will not accept ports in the name.
So I have tried to add .htaccess file to my htdocs that contains:
RewriteEngine on
RewriteRule ^:8888/(.*)$ /$1 [L]
But that did not work.
So I have tried to create Virtual Hosts in httpd.conf adding the following at the bottom:
<Directory "C:/xampp/htdocs/www/wp.dev">
Order Deny,Allow
Allow from all
</Directory>
<Directory "C:/xampp/htdocs/">
Order Deny,Allow
Allow from all
</Directory>
NameVirtualHost 127.0.0.1:8888
<VirtualHost 127.0.0.1:8888>
DocumentRoot "C:/xampp/htdocs/"
ServerName localhost2
</VirtualHost>
<VirtualHost 127.0.0.1:8888>
DocumentRoot "C:/xampp/htdocs/www/wp.dev"
ServerName wp.dev
</VirtualHost>
And then I added the following to my hosts file (Help):
127.0.0.1:8888 localhost2
127.0.0.1:8888 wp.dev
And that hasn't worked. I cannot use port 80 as an option, so I need to figure this out. So what am I doing wrong?
Unfortunately WordPress MS requires port 80 to work. You can check the requirements in this link
If using that port in your local machine is not an option for you, what you could consider is to work with a Virtual Machine. (This is the link to the BitNami WordPress virtual appliance in case you want to try it.)