|
12 years ago 6 |
The following tutorial walks you through the process of installing Wordpress on Linux Mint and configuring Apache for SEO URL's - required if you want your site to rank well on Google and other major search engines (SEO stands for Search Engine Optimisation).
To install Wordpress on Linux Mint you would enter the following:
apt-get update && apt-get upgrade apt-get install wordpress
Open the default htaccess file:
vim /etc/wordpress/htaccess Add the following lines if they do not already exist:
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.+) [NC] RewriteRule ^.*$ http://%1%{REQUEST_URI} [QSA,R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
vim /etc/apache2/sites-available/your-blog.com
Add the following Apache Vhost config:
<VirtualHost 192.168.1.2:80>
vim /etc/apache2/sites-available/your-blog.com
Add the following Apache Vhost config: <VirtualHost 192.168.1.2:80>
ServerName www.your-blog.com ServerAdmin me@your-blog.com DocumentRoot /var/www/www.your-blog.com DirectoryIndex index.php <Directory /var/www/www.your-blog.com/> AllowOverride All Order Deny,Allow Allow from all </Directory> </VirtualHost>
cd /var/www/ ln -s /usr/share/wordpress your-blog.com
a2ensite www.your-blog.com a2ensite your-blog.com /etc/init.d/apache2 restart
If you get a permissions error that looks like:
/usr/share/doc/wordpress/examples/setup-mysql: Permission denied
You can fix this by doing the following:
chmod 700 /usr/share/doc/wordpress/examples/setup-mysql
Then re run the command again, this should then work!
When you enable Wordpress Permalinks for nice url's you have to update the .htaccess file manually, by adding the following code to it:
RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
You will probably notice that your Permalinks still 404 even after you have updated your .htaccess file, to fix this you need to enable Mod_Rewrite in Apache.
To enable mod_rewrite enter the following as root:
a2enmod rewrite
You will also need to restart Apache on Linux Mint:
/etc/init.d/apache2 resert
That's it any problems or questions please post a comment.
First 2 command require "sudo " in front. 3rd command "vim" not recognized.
thanks...