Permalink WordPress on Ubuntu, a configuration apache2

It is a story of an experience when a friend asked to move his website from a hosting to VPS (Virtual Private Server). Originally hosting service configuration file easier wordpress, but when transferred to the VPS which incidentally configuration should be done alone, then this problem ketemulah.

Wordpress .htaccess file is a file determinant in the permalink of the website with wordpress. Here's how ubuntu server configuration for the purposes permalink, obtained from Here.

Create file “.htaccess” manually and save it in the root directory of WordPress. (This is the directory where wp-admin, wp-includes, and wp-content are)

Open Terminal on Ubuntu (via ssh), logged in as root and type the following command:

sudo chown -v :www-data “/FilePath/.htaccess”

You will get a line description that (group) file ownership has been changed to www-data (Apache2).
Give Apache2 write access to the file:

sudo chmod -v 664 “/FilePath/.htaccess”

Next we must allow (allow) WordPress to write the .htaccess file by enabling mod_write on Apache2 server. Type the following command in the terminal:

sudo a2enmod rewrite

You will see the information that the module has been enabled
Then restart Apache2 with the command:

sudo service apache2 restart

After the above is done go into Dashboard wordpress (eg http://www.domainanda.com/wp-admin) and open the Settings menu –> Permalink permalinks and select the format according to your wishes. then click “Save Changes”.

Next, make sure you add AllowOveride All the site-available configuration setup your domain (/etc/apache2/sites-available/domainanda.com.conf) as follows:

<VirtualHost *:80>
DocumentRoot “/var/www/domainanda”
ServerName domainanda.com
<Directory “/var/www/domainanda”>
allow from all
Options Indexes
AllowOverride All
</Directory>
</VirtualHost>

Well so sedikip experience that might be useful. good luck!..

Pin It

Leave a Reply

Your email address will not be published. Required fields are marked *