I was running into a frustrating permissions issue when trying to setup FTP access for various users. They couldn’t follow a symlink to the /var/www/sitefolder for their respective vhost.

I worked around this by making their www sitefolder their HOME directory for their user account. As the user exists purely for the website then this was an effective workaround.

useradd -d /var/www/sitefolder username

Now when logging in via FTP I am greeted with the respective www files and can upload and download accordingly.

I was going round in circles trying to get WordPress permalinks to work on a Ubuntu server with Apache2 installed.

The .htaccess file was fine:

# BEGIN WordPress
#
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#

# END WordPress

However I still got Error 404 page not found when I went to siteurl.com/page-name rather than siteurl.com/?p=123

In the end it turns out I needed to make a tweak to the Apache virtualhost.conf file for the site in question:

By default in the section it had

AllowOverride None

This needed to be changed to

AllowOverride All

A quick

service apache2 reload

And, hey presto, permalinks were working again.

I wanted to check that suPHP was working correctly and executing scripts under a specific user id.

This little PHP script did the trick.

php echo ‘whoim = ‘.exec(‘/usr/bin/whoami’);

That echo’d (outputted) the result of running a file /user/bin/whoami

I had a frustrating error for a while when using suPHP. It kept giving error 500 when enabling mod_suphp for .php files:

Directory /var/www is not owned by user

Of course, the directory was not owned by the user. The user belonged to a sub-directory only, the reason behind using suPHP.

It turned out to solve this the directory /var/www had to be owned by user root. That fixed the error.

I was configuring an apache2 setup to work with suPHP and ran into various Internal Server Error 500s due to folders and files having too generous permissions on them. suPHP doesn’t like that.

These two commands, when run from the directory where the web files reside, will recursively reset the permissions as required.

Find files and set to permissions 644

sudo find . -type f -exec chmod 644 {} \;

Find folders and set to permissions 755

sudo find . -type d -exec chmod 755 {} \;

This problem keeps hitting me each time I install a fresh wordpress blog.

Not Found

The requested URL /home-network/ was not found on this server.

Every time I have to re-google until I find the solution.

For reference, I’m running Apache2 on an Ubuntu machine.

The content appears correct in the .htaccess file within the base directory:

<IfModule mod_rewrite.c>
RewriteEngine On RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /index.php/$1 [L,QSA]
</IfModule>

The issue falls within /etc/apache2/sites-available/nameoffile.conf

The following must be modified:

AllowOverride None

to

AllowOverride All

You will probably only run into this if you’re a systems administrator, or if your web-host has not set this up correctly.  Changing the wording and issuing:

service apache2 reload

Did the trick for me.  If it didn’t, you wouldn’t see this page.