Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Wordpress on MooseVZ
New on LowEndTalk? Please Register and read our Community Rules.

Wordpress on MooseVZ

Anyone here installed wordpress on a MooseVZ VPS?

I've installed it manually, however run into updating issues with plugins / themes etc. I assumed it was a permission issue, but it doesn't appear to be so. (prompting for ftp info to update / install them)

If I install it via installatron the install works flawless. I don't mind using the installatron however, its bugging me that the manual install isnt quite working as it should.

Even as recommened, I can manually chmod all the folders permissions to 777, and still have the issue (manual install). I have also reset all file permissions to the recommended 644. Same issue. Any ideas?

Comments

  • What webstack you're running?
    Who's the web user?
    Who's the web app user? Nginx, apache, www-data, httpd?
    I can paste in sample config for nginx and php5-fpm if you want.

    Thanked by 1Junkless
  • apache

  • sorry, the user is www-data. im getting click happy today it seems

  • Can't help you with apache I'm afraid. I better like nginx and php5-fpm with mariadb.

    tomahawkeer said: sorry, the user is www-data. im getting click happy today it seems

  • doughmanesdoughmanes Member
    edited October 2015

    wp-content/uploads needs to be writable and proper ownership. I had this issue this weekend with a manual install of Wordpress.

  • @doughmanes said:
    wp-content/uploads needs to be writable and proper ownership. I had this issue this weekend with a manual install of Wordpress.

    I manually went through and changed all permissions on all folders to 777, and still had the issue. How did you resolve it?

  • doughmanesdoughmanes Member
    edited October 2015

    777 for wp-content/uploads and nginx:nginx for permission.

    apache:apache or www-data:www-data will work for you on ownership

  • GM2015GM2015 Member
    edited October 2015

    777 is terrible security wise. 755 is recommended and that the webserver can write to the wp-content directory.

    On nginx, my systemuser/webuser is the one I use on the terminal. And the systemuser(webuser1) owns the public folder.

    This is based on debian jessie and nginx mainline 1.9.5

    This is from /etc/nginx/nginx.conf:

    user  www-data;
    worker_processes  1; #1 worker per cpu core
    
    error_log  /var/log/nginx/error.log warn; #you can turn this off with error_log off;
    pid        /var/run/nginx.pid;
    
    
    events {
        worker_connections  1024; #there's a digitalocean article on this on google
    }
    
    
    http {
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;
    
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';
    
    #    access_log  /var/log/nginx/access.log  main;
         access_log off; #bunch of values I found on google
         client_max_body_size 12M;
         client_body_buffer_size 10K;
         client_header_buffer_size 1k;
         proxy_connect_timeout  600s;
         proxy_send_timeout  600s;
         proxy_read_timeout  600s;
         fastcgi_send_timeout 600s;
         fastcgi_read_timeout 600s;
    
        sendfile        on;
        #tcp_nopush     on;
    
        client_body_timeout 12;
        client_header_timeout 12;
        send_timeout 10;
        keepalive_timeout  65;
    
        gzip on;
            gzip_disable "msie6";
    
            gzip_comp_level 2;
            gzip_min_length  1000;
            gzip_proxied     expired no-cache no-store private auth;
            gzip_types       text/plain application/x-javascript text/xml text/css application/xml;
    
        include /etc/nginx/conf.d/*.conf; #this folder contains your "virtual servers" or vhosts on apache
    }
    

    One webapp.conf from conf.d:
    I will refer to webapp as that's what the example will be after www/webapp and in the php socket too.

    server {
        listen 80;
    
        root /home/webuser1/www/webapp;
        index index.php index.html index.htm;
    
        server_name domain.com domain.com;
    
        location / {
                try_files $uri $uri/ /index.php;
        }
    
        
    
            location ~* /(?:uploads|files)/.*\.php$ {
               deny all;
                 }
    
      # Deny access to hidden files
        location ~* /\. {
        deny            all;
        access_log      off;
        log_not_found   off;
        }
    
    
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
                fastcgi_pass unix:/home/webuser1/www/run/webapp.php5-fpm.sock;
                fastcgi_read_timeout 300;
        }
    
    
       location ~* .(jpg|jpeg|png|gif|ico|css|js)$ {
            expires 365d;
       }
    
    }
    
    

    Php5-fpm pool file from /etc/php5/fpm/pool.d/webapp.conf

    [webapp]
    
    ;prefix = /path/to/pools/$pool
    
    user = webuser1
    group = webuser1
    
    listen = /home/webuser1/www/run/$pool.php5-fpm.sock
    
    listen.owner = webuser1
    listen.group = www-data
    listen.mode = 0660
    
    ;listen.allowed_clients = 127.0.0.1
    
    pm = static #you can set this to ondemand instead and change max children and process idle timeout to fit your needs and all values below it.
    
    pm.max_children = 2
    
    pm.start_servers = 2
    
    pm.min_spare_servers = 1
    
    pm.max_spare_servers = 3
    
    ;pm.process_idle_timeout = 10s;
     
    pm.max_requests = 10000
    
    ;pm.status_path = /status
     
    ;ping.path = /ping
    
    ;ping.response = pong
    
    ;access.log = log/$pool.access.log
    
    ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
     
    ;slowlog = log/$pool.log.slow
     
    ;request_slowlog_timeout = 0
     
    ;request_terminate_timeout = 0
     
    ;rlimit_files = 1024
     
    ;rlimit_core = 0
     
    ;chroot = 
     
    chdir = /
     
    ;catch_workers_output = yes
    
    ;clear_env = no
    
    ;security.limit_extensions = .php .php3 .php4 .php5
     
    ;env[HOSTNAME] = $HOSTNAME 
    ;env[PATH] = /usr/local/bin:/usr/bin:/bin #owncloud recommend uncommenting this line, value can be find via "env" I believe
    ;env[TMP] = /tmp
    ;env[TMPDIR] = /tmp
    ;env[TEMP] = /tmp
    
    

    Not the best logged system, but wordpress works and doesn't give webserver access/write errors.

    It could surely do optimizations and all that, but for a low traffic site it works.

    I don't know how secure it is, but I run each domain/subdomain on different users, but www-data remains the same in php5-fpm config. I also use different php5-fpm socket files.

    The webuser/www/appname structure was taken from serverpilot.io, they do /srv/users/username/apps/appname/public. Mine is shorter and less logged anyway.

    I try to learn this on my own as well to become independent of their free services, which is nice, but better to learn this stuff.

    tomahawkeer said: I manually went through and changed all permissions on all folders to 777, and still had the issue. How did you resolve it?

  • The 777 is how installatron sets the directories / subs, however the manual install has all of them at 755, which is what it should be period, however the manual install will not allow it with 755 or 777. Installatron has to be doing something, that the manual install doesn't do, to be making it function like its supposed to.

  • Try nginx and do this manually.

    It took me hours to figure the above config out, but now I can make a new domain in 5 minutes manually.

    after the above config is done, a new domain/subdomain is just making a A/AAAA record and downloading wordpress/unzipping it.

    Mysql is easy as well:

    mysql or mysql -u root -p #if you've got .my.cnf, then mysql is enough
    then once logged into mysql:
    show databases;
    create database dbname;
    create user 'dbusername'@'localhost' identified by 'password';
    grant all on dbname.* to 'dbusername'@'localhost';
    flush privileges;
    quit
    

    tomahawkeer said: The 777 is how installatron sets the directories / subs, however the manual install has all of them at 755, which is what it should be period, however the manual install will not allow it with 755 or 777. Installatron has to be doing something, that the manual install doesn't do, to be making it function like its supposed to.

  • Thanks for the feedback. Ill take a look at nginx later tonight or tomorrow. I'm new to running linux and VPS , but im slowing getting the hang of it.

  • You can try serverpilot's free plan which is good and light enough to run websites on. It's fairly secure and they keep updating your server's software security wise.

    But it only runs on ubuntu 14.04/12.04 64 bit, which why I try to leave it. I don't like ubuntu's attitude to dash search, plus it's a bastard of debian. Debian all the way.

    tomahawkeer said: Thanks for the feedback. Ill take a look at nginx later tonight or tomorrow. I'm new to running linux and VPS , but im slowing getting the hang of it.

  • gestiondbigestiondbi Member, Patron Provider

    This is one of the reasons why this forum exist! Help each other! :)

    Thanked by 1MikePT
  • GM2015GM2015 Member
    edited October 2015

    You can try nginx php5 fpm mariadb on a new debian jessie install with the following code:

    Run this as root.
    Clean the server a bit.

    apt-get -y remove --purge apache* samba* sendmail* bind9* nscd* sasl* exim* ntp vim
    apt-get clean
    

    This will install nginx mainline from nginx.org directly. https://gist.github.com/hpherzog/8824136
    nano nginx-mainline.sh

    #!/bin/sh
    
    # Remove nginx that is already installed.
    apt-get purge nginx
    apt-get autoremove
    
    (cat <<-SRC
    # nginx mainline repository
    deb http://nginx.org/packages/mainline/debian/ jessie nginx
    deb-src http://nginx.org/packages/mainline/debian/ jessie nginx
    SRC
    ) > /etc/apt/sources.list.d/nginx-mainline.list
    
    wget http://nginx.org/keys/nginx_signing.key
    apt-key add nginx_signing.key
    
    apt-get update
    apt-get install nginx
    

    You can then run

    bash nginx-mainline.sh

    to install nginx mainline.

    You could use

    deb http://nginx.org/packages/debian/ jessie nginx
    deb-src http://nginx.org/packages/debian/ jessie nginx

    for nginx stable 1.8.0 instead.

    You can use the mariadb.com for mariadb https://downloads.mariadb.org/mariadb/repositories/
    Debian Jessie from London for example:
    https://downloads.mariadb.org/mariadb/repositories/#mirror=digitalocean-lon&distro=Debian&distro_release=jessie--jessie&version=10.1

    #Here are the commands to run to add MariaDB to your system:
    
    sudo apt-get install software-properties-common
    sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
    sudo add-apt-repository 'deb http://lon1.mirrors.digitalocean.com/mariadb/repo/10.1/debian jessie main'
    
    #Once the key is imported and the repository added you can install MariaDB with:
    
    sudo apt-get update
    sudo apt-get install mariadb-server
    
    #See Installing MariaDB .deb Files for more information.
    
    #You can also create a custom MariaDB sources.list file. To do so, copy and paste the following into a file under /etc/apt/sources.list.d/ (we suggest naming the file MariaDB.list or something similar), or add it to the bottom of your /etc/apt/sources.list file.
    
    echo "# MariaDB 10.1 repository list - created 2015-10-19 19:59 UTC" >> /etc/apt/sources.list.d/mariadb
    echo "# http://mariadb.org/mariadb/repositories/" >> /etc/apt/sources.list.d/mariadb
    echo "deb http://lon1.mirrors.digitalocean.com/mariadb/repo/10.1/debian jessie main" >> /etc/apt/sources.list.d/mariadb
    echo "deb-src http://lon1.mirrors.digitalocean.com/mariadb/repo/10.1/debian jessie main" >> /etc/apt/sources.list.d/mariadb
    

    php5-fpm is just

    apt-get install php5-fpm
    

    Also take a look at https://www.vultr.com/docs/setup-up-nginx-php-fpm-and-mariadb-on-debian-8 which is what I've used before googling around.

    You'll want to install some php5 extensions if your websites need it.

    tomahawkeer said: Thanks for the feedback. Ill take a look at nginx later tonight or tomorrow. I'm new to running linux and VPS , but im slowing getting the hang of it.

  • emperoremperor Member
    edited October 2015

    @tomahawkeer

    I had same problem with other host, after some hours i found issue to be file ownership. chown -R php:php * inside the folder solved it for me.

    However, I revert it back to nginx:nginx after update.

  • sinsin Member

    You need to make sure the php-fpm pool permissions are set correctly...open up /etc/php5/fpm/pool.d/www.conf and find

    user = www-data
    group = www-data

    and

    listen.owner = www-data
    listen.group = www-data
    listen.mode = 0660

    Make sure those are set to whatever nginx is running as (www-data or nginx)

  • @emperor
    That solved the WordPress permissions for me but I was using vesta so I used admin:admin in my case...:-)

    you need to try www-data:www-data

  • tomahawkeertomahawkeer Member
    edited October 2015

    Well, I finally got around to installing nginx on my server, and the server itself appears to be running fine, however, the info.php file ive created is displaying as just a blank page.

    I've been troubleshooting it now for about 45 min and still no luck. Its getting kind of late atm (coming up on 230 am lol) might have to look at it tomorrow with a fresh pair of eyes, and a clearer brain / thought process.

    Here is my top:

      PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
        1 root      20   0  2304  620  596 S   0.0  0.1   0:00.03 init
        2 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kthreadd/2539
        3 root      20   0     0    0    0 S   0.0  0.0   0:00.00 khelper/2539
     1339 root      20   0 33856 1264 1080 S   0.0  0.1   0:00.00 rsyslogd
     1471 root      20   0  9276 2676 2420 S   0.0  0.3   0:00.92 sshd
     1473 root      20   0  3760 2252 1504 S   0.0  0.2   0:00.23 bash
     2038 root      20   0  6528  720  616 S   0.0  0.1   0:00.00 sshd
     2130 root      20   0  2352  788  656 S   0.0  0.1   0:00.00 cron
     9577 root      20   0  2940 1044 1040 S   0.0  0.1   0:00.00 mysqld_safe
     9905 mysql     20   0  349m  31m 6692 S   0.0  3.1   0:01.99 mysqld
     9906 root      20   0  1872  476  472 S   0.0  0.0   0:00.00 logger
    10769 Debian-e  20   0  9660 1100  596 S   0.0  0.1   0:00.00 exim4
    15457 root      20   0 15896 1180  332 S   0.0  0.1   0:00.00 nginx
    15460 www-data  20   0 16040 1532  528 S   0.0  0.1   0:00.05 nginx
    15461 www-data  20   0 16040 1532  528 S   0.0  0.1   0:00.03 nginx
    15462 www-data  20   0 16040 1532  528 S   0.0  0.1   0:00.04 nginx
    15463 www-data  20   0 16304 2100 1016 S   0.0  0.2   0:00.00 nginx
    15649 root      20   0  104m 4000 1436 S   0.0  0.4   0:00.00 php5-fpm
    15651 www-data  20   0  104m 3932 1348 S   0.0  0.4   0:00.00 php5-fpm
    15652 www-data  20   0  104m 3932 1348 S   0.0  0.4   0:00.00 php5-fpm
    15671 root      20   0  3012 1192  888 R   0.0  0.1   0:00.00 top
    
  • @tomahawk: have you tried restarting the VPS

  • Yeah no change unfortunately

  • tomahawkeer said: Yeah no change unfortunately

    :/ all I do is apt-get install nginx php5-fpm and then add php to nginx vhost in /etc/nginx/sites-available/enabled . Then restart.

    Thanked by 1Aga
  • Out of curiosity, are you running Debian, and if so what version ?

  • tomahawkeer said: Out of curiosity, are you running Debian, and if so what version ?

    I did (7) now I run Ubuntu (14.04). The procedure is the same on both.

    I enable PHP with this:

    location ~ ^(.+\.php)(.*) {
    try_files $fastcgi_script_name =404;
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    }
    
  • Thats exactly what I have in my config, and still not working.

  • tomahawkeer said: Thats exactly what I have in my config, and still not working.

    :/ then I guess I would check the nginx and php logs ( /var/log/php5-fpm.log and /var/log/nginx/error.log for me)

  • Take a look at the php5-fpm notes I pasted in here and try to use that.

    tomahawkeer said: Thats exactly what I have in my config, and still not working.

  • tomahawkeertomahawkeer Member
    edited October 2015

    I actually went through them pretty good last night. I am going to change OS to Debian 8. All my testing thus far has been on 7.

    If I get to having the same issues in 8 I'll post all my configuration and logs in depth.

  • tomahawkeer said: I actually went through them pretty good last night. I am going to change OS to Debian 8. All my testing thus far has been on 7.

    If I get to having the same issues in 8 I'll post all my configuration and logs in depth.

    Why did you not try EasyEngine?

  • I've used my above notes for debian 7 as well. The only difference is that you need to swap "jessie" for "wheezy" in the mariadb part, nginx part and if you want php5.6-fpm on your server use this script:

    #To install PHP 5.6 on Wheezy, you can add this repo:
    echo "deb http://packages.dotdeb.org wheezy-php56 all" >> /etc/apt/sources.list.d/dotdeb.list
    echo "deb-src http://packages.dotdeb.org wheezy-php56 all" >> /etc/apt/sources.list.d/dotdeb.list
    
    #Add the key:
    wget http://www.dotdeb.org/dotdeb.gpg
    apt-key add dotdeb.gpg
    
    #And install PHP:
    apt-get update -y
    apt-get install php5-cli php5-fpm php5-gd php5-mcrypt php5-mysqlnd -y
    
    

    The only thing php-fpm needs changing for basic usage is a couple of lines of /etc/php5/fpm/php.ini, which https://www.vultr.com/docs/setup-up-nginx-php-fpm-and-mariadb-on-debian-8 article describes well for basic usage.

    On debiaj jessie, because of fresher repos by default, apt installs php5.6.x-fpm, while wheezy installs 5.4.x by default.

    The above dotdeb.org repo has php5.6-fpm in stock after apt-get update.

    tomahawkeer said: I actually went through them pretty good last night. I am going to change OS to Debian 8. All my testing thus far has been on 7.

    If I get to having the same issues in 8 I'll post all my configuration and logs in depth.

Sign In or Register to comment.