Yesterday we installed the software we’ll use to run WordPress. Today we’ll configure it all up.
The Apache web server
Let’s start with some simple stuff: PHP.
Edit /etc/php.d/ini and modify one line:
$ sudo nano /etc/php.d/apc.ini
You want to change a line to look like this:
; The mktemp-style file_mask to pass to the mmap module apc.mmap_file_mask=/apc.shm.XXXXXX
Most config files look like “name = value”. When I say “change a line,” what I’m meaning is find the line that starts with the name and change the value.
Once you’ve changed it, save the file.
Next up need to configure Apache to serve up the directory we want.
$ sudo nano /etc/httpd/conf.d/blog.vec.com.conf
I like to name the configuration files after what’s being served by that configuration. You can really call it anything that ends with “.conf”. You probably don’t want to call it “yoursite.com”. Just sayin’. :-)
Put this in the new file:
<VirtualHost *:80> ServerName www.yoursite.com DocumentRoot /var/www/www.yoursite.com <Directory /var/www/www.yoursite.com> Options FollowSymLinks Allow from all AllowOverride all </Directory> </VirtualHost>
Like before, replace the “yoursite.com” with something more useful to you. Whatever you put there will dictate what your server will respond to. (Assuming you have the DNS pointed to the server)
Before we restart Apache, let’s make the directory.
$ sudo mkdir /var/www/yoursite.com $ sudo service httpd restart
As an added bonus, you can host multiple sites on one server as well, just add additional configs and make more directories.
MySQL
First, let’s start up mysql with their default medium config:
$ sudo cp /usr/share/mysql/my-medium.cnf /etc/my.cnf $ sudo chkconfig mysqld on $ sudo service mysqld start $ /usr/bin/mysql_secure_installation
After the last command you’ll be prompted to set your main “root” database password. Set it to something secure. The rest of options are pretty much spot on.
As an added bonus, you now know that MySQL is working just fine!
Next up: Setting up WordPress! Finally!
Finished this one.
I got a little bit confused at the “yoursite.com” part. I’m not sure what this should be. I tried substituting “yoursite.com” in the blog.schmi.com.conf file with “testgwwr.com” but that didn’t work. When I did httpd restart I got a warning saying that /var/www/www.testgwwr.com did not exist.
What am I doing wrong?
Never mind, I figured it out. :) I just fixed the path in the config.
When you get a chance to update this guide, it would be helpful to explain exactly why you are recommending:
; The mktemp-style file_mask to pass to the mmap module
apc.mmap_file_mask=/apc.shm.XXXXXX
What exactly does that minor change do and why is it important to implement? It’s the one thing you sped through w/o much explanation otherwise. :)