I was discussing about how to install MySQL and configure it with Apache and PHP in my earlier articles. This is the 3rd and final article of the series for configuring wordpress on Solaris from scratch. Once the MySQL, Apache and PHP are working together, wordpress (or any CMS) can be installed and configured easily.
Go ahead and download the latest version of wordpress from wordpress.org and extract the archive to apache htdocs directory. You may also extract the archive to any other directory and create a symbolic link in htdocs to that directory. [For this example, I will copy the installation to wordpress directory in htdocs. Hence my site address will be http://hostname/wordpress.%5D
WordPress needs a MySQL user and a database for keeping its data. You may use the mysql user to create the database. But it is advisable to use a separate user for wordpress and grant it all the permissions over its tablespace.
To create a user in MySQL, logon as root or mysql user to MySQL and execute the following command.
CREATE USER ‘anyuser’@’localhost’
IDENTIFIED BY PASSWORD ‘anypassword’;
Now, create a database in MySQL and grant all permissions over that table to wordpress user.
CREATE DATABASE wordpress;
GRANT ALL ON wordpress.* TO 'anyuser'@'localhost'
IDENTIFIED BY ‘wordpressuserpassword’;
Execute the following command to copy existing config file for wordpress and fill in your values.
cd /usr/local/apache2/htdocs/wordpress
cp wp-config-sample.php wp-config.php
Open an editor and edit wp-config.php file for your database details. Look into wordpress configuration manual for editing the entries.
If you are already using your webserver for php files, then you may skip this step. Otherwise, your Apache installation might have not been configured to recognize index.php as an index file. Create a .htaccess file in your web root [/usr/local/apache2/htdocs for example] and add the following line in the file:
DirectoryIndex index.php
Now, your http configuration file for apache might also not have been configured to read the above configuration. To do that, open your apache configuration file (httpd.conf) and replace the following line
AllowOverride None
with
AllowOverride All
For detailed configuration of AllowOverride feature look here.
Now, your apache has been configured to identify php files as index files, which is essential to run wordpress.
Now, open the following URL in your browser and follow the steps to configure wordress. Details can be found at the wordpress installation manual.