We help IT Professionals succeed at work.
Get Started

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

547 Views
Last Modified: 2014-11-23
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.

        servername raymondrider.com
        Serveralias www.raymondrider.com

        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
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

My domain of raymondrider.com 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: http://www.raymondrider.com/wp-admin?
Comment
Watch Question
Fixer of Problems
CERTIFIED EXPERT
Most Valuable Expert 2014
Commented:
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE