troubleshooting Question

How to Make Wordpress One of Apache2's Virtual Hosts?

Avatar of RayRider
RayRider asked on
Windows NetworkingWordPressApache Web Server
9 Comments1 Solution549 ViewsLast Modified:
Maybe I am trying to do something that  isn't possible. Please allow me to explain what environment I have, what I have done that works, and finally, what I wish to do that I cannot get to work.

I have Ubuntu server 14.04 LTS. I have installed LAMP. I have the Apache2 server working with the default server and two new virtual servers that work just great with both the domain name, with and without the "www" at the front. MySQL is working. I have configured a "wordpress user and database". I have created a wordpress configuration PHP file (wp-config.php) that contains the correct MySQL database, user and password.

When I added the Wordpress installation, I wasn't sure what to do with the virtual server configuration in /etc/apache2/sites-available. I have copied the 000-default.conf file to a file named wordpress.conf. Below is a paste of that configuration;

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.


        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/wordpress

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

My domain of was just modified to point to the static ip of the router. Of course, it takes a few hours to update. In the meantime I have added these two domains to my Windows 7 "hosts" file in order to get a host referrer name to be sent to the Apache2 server. I pinged these two hosts and they indeed are routed to the IP address of the Apache2/Wordpress server.

After much time and many changes which I tried, I am unable to see the wordpress site. I am not sure how to get http requests over to the Wordpress virtual host. As far as I can tell, the Wordpress looks just like another virtual host site, and is configured similar to the other two working sites. I am missing something in my understanding.

Shouldn't I be able to get to the Wordpress site via my browser URL:
Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros