• Resolved rob54321

    (@rob54321)


    Hi,
    I have read many posts related to .htaccess not being writeable, but none have solved my problem.

    My setup:
    Ubuntu Linux 14.10 using apache2 2.4.10.
    I have all the necessary apache2 modules loaded: rewrite, cgid, php5 etc.

    Directory structure:
    I have placed WP files and directories in /var/www/html
    The file /var/www/html/wp-content/plugins/akismet/.htaccess has had permisions 666, 777, 644 and ownerships root.root, root.www-data, root.robert robert.robert, www-data.www-data.
    I have also included

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    in the file.
    None of the above has worked. WP says .htaccess is NOT writeable.

    Other things I have tried:
    I have restarted the apache2 server after each change, I have changed the apache2 environment variables APACHE_RUN_USER, APACHE_RUN_GROUP etc. I have edited apache2.conf to make it use any directory.
    Nothing I do can make /var/www/html/wp-content/.htaccess writeable.

    Is there an incompatibility between WP and Linux?

    Would it be better to run it on Microsoft OS’s or IOS?
    Any help would be appreciated,
    Thanks,
    Rob

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Is there an incompatibility between WP and Linux?

    Nope. WordPress and Linux work just fine together. It’s generally preferred over Windows or Mac OSX though those two operating systems work too.

    Your file ownership for the WordPress .htaccess file may be incorrect. Try

    chown www-data:www-data .htaccess

    and see if that fixes it. If you are using the stock Ubuntu setup (and you really should) then that should work for you.

    Thread Starter rob54321

    (@rob54321)

    Hi Jan, and thanks.

    I have actually solved it and wanted to report my findings here as I’m sure there are some other linux users who had the same issue.

    When apache2 is installed the the web root is /var/www/html for the latest version. Unfortunately all the files are set to root.root ownership. Even the directories are marked as so.

    The problem is not the ownership permissions of .htaccess, but the ownership of the parent directory /var/www/html.
    This should be:

    drwxr-xr-x 5 www-data www-data 4096 Dec 28 12:45 html

    which has a mod of 755.

    I then changed all files and directories to www-data.www-data.
    All done as root:

    /var/www# chown -R www-data.www-data *

    I also changed all directories to mod 755

    /var/www# find html -type d -exec chmod 755 {} \;

    I also set apache2 environment vars in /etc/apache2/envvars to

    export APACHE_LOCK_DIR=/var/lock/apache2
    export APACHE_RUN_USER=www-data
    export APACHE_RUN_GROUP=www-data
    export APACHE_LOG_DIR=/var/log/apache2
    export APACHE_PID_FILE=/var/run/apache2/apache2.pid
    export APACHE_RUN_DIR=/var/run/apache2

    and now it works!! Yay /var/www/html/.htaccess is writable by WP.

    The crucial thing is.
    /var/www/html MUST be owned by www-data which it is not when one installs apache2.

    Hope this helps others and thanks for your help.
    Rob

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘.htaccess is World Writeable but WP says 'not'.’ is closed to new replies.