Creating a new Website with Wordpress on an Apache Webserver


One of the things I like best ablout wordpress is that is allows you to quickly and easily get a professional looking website up and running in a flash.  Creating multiple websites with Wordpress is a snap.   

To create a new site or test site, do the following:

  1. Create a New CName record with your Registar.  Make sure there is a CName record for your domain with your registar (ie, GoDaddy, etc).  The CName used for a website is typically www but it can be pretty much anything else as well.  For a test site, you may wish to have a CName record of test.  You would then get to your test site by using http://test.yourdomain.com.  This CName record would typically point to your main IP address.  For GoDaddy the default to reference this AREcord is the @ symbol.  The A record typically contains the IP address of the computer that hosts yoru site.
  2. Edit your httpd.conf file to point to a new location.  Now that you have a CName record point to your IP address, you need to make sure that your web server know what to do when someone hits test.mydomain.com.  By default, it will probably take you to the same default web site.  On a CentOS installation, this would the index page that is located in the /var/www/html directory.  However, we want a new site, so we need to tell the system to go to a new location for different webpages.  You do this by editting the httpd.conf file and adding a Virtual Host Directive.  

<VirtualHost *:80>
DocumentRoot /var/www/test.mydomain
ServerName test.mydomain.com
</VirtualHost>.

If you are hosting multiple site, you may wish to separate these VirtualHost directives into files in a sites folder in the httpd folder and then include them in the httpd.conf file using the Include sites/test.mydomain.site line.

After making these changes, you must restart your httpd service.  Now test.mydomain.com is point to the right location.  Now we add the wordpress site.

  1. Unzip the wordpress gz file in the new test.mydomain folder located in /var/www/ folder. 
  2. If you have themes and plugins that you typically use, you can copy and paste them from the /wordpress/wp-contents folders to you new folder.
  3. Create a new mysql database for this instance of wordpress.  Typically for multiple site, something like XXX_wordpress works well where XXX is the name of the site.
  4. Edit the wordpress/wp-config-sample.php file and enter in the database information and save file as wp-config.php
  5. Run http://test.mydomain.com/wordpress/wp-admin/install.php, this will use the config file  and create the tables and install wordpress.  It will also give you and admin password.  Be sure to record the password.
  6. Login into the system using http://test.mydomain.com/wordpress/wp-admin/.  There you can get going with the final settings.  If you copied themes and plugins, you may wish to activate them. 
  7. Change the settings so that http://test.mydomain.com will open the blog instead of having to using the /wordpress extension.  This is done by going to the admin|settings|general page and changing the Blog address to http://test.mydomain.com.
  8. Copy the index.php and .htaccess file fro mthe wordpress directory to the root directory of your site (Blog address)
  9. Edit the index.php file so that the wp-blog-header.php points to the directory above.  ./wordpress/wp-blog-header.php.
  10. Check out Giving WordPress Its Own Directory for more valuable info.
  11. Now you are good to go with a brand new website.  Enjoy…

  1. No comments yet.
(will not be published)
  1. No trackbacks yet.