Linux Permissions

Hi!

Permissions issue:

I am using a debian webserver 100% ssh (no hosting control panel).

To Get WordPress downloaded - I used wget on my SSH username (not root - I do have sudo).

Then extracted it - went to install it and the installer could not write the wp-config file.

Couple of things:

the files are assigned to nobody:nogroup

URL structure is /var/www/domain.com/public_html.

Any thoughts on how to get the correct permissions?
LVL 3
Computer GuyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

omarfaridCommented:
What are the file perms?
Kent WSr. Network / Systems AdminCommented:
Per instructions on WP, if you want the installer to write the config for you, you simply need to give your web user write perms to the wp-config.php file . Afterward it has updated the config file, it will "complain" until you set the perms back to non-writable (as it should). The alternative - just open the wp-config.php file and put in the appropriate settings yourself. This is really nothing more than the dbname, host, and db perms. Save, move on. The installer will detect you have a "good" config file.  

To get a good "wp-config.php" file, copy the included "wp-config-sample.php", give the appropriate database credentials you have setup for mysql (DB_NAME, DB_USER, DB_PASSWORD, DB_HOST), then save, and, most importantly, make sure you save it as file name "wp-config.php".

That's about all there is to it.
Steven VonaCommented:
AS simple fix would be to run the command:

chmod 777 wp-config.php

This will allow read/write/execute by anybody.  It is however unsafe.

To correct the problem, you should find out what username your webserver runs as.  It is usually "apache" or "httpd".

If your http service is running as apache, your should make all the files owned by apache by running this command in the root web directory:

chown -R apache:apache *

(Change apache to whatever the name is your web service is running as).

From there, you can set the proper permissions on files.  To start with something safe you can do:

chmod -R 744 *

That should also allow you to write the config file as well.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kent WSr. Network / Systems AdminCommented:
Above comment is true, Apache only needs write access to the config file ONCE. After its created, you can safely change it to 440.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WordPress

From novice to tech pro — start learning today.