Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My system specifications: Samsung RV509, i3, 300GB HDD, 3GB Ram, Dual boot Windows7 & LM 17.3 Rosa.
Home server: LAMP
Content management system: WordPress
Domain name: I have not taken a registered domain name yet.
I have successfully installed LAMP & WordPress. I can login to my wordpress dashboard, too with no problems. However the the WordPress cannot access my LAMP server. I cannot Update plugins or Install plugins, upload pictures. I get the following kinds of errors;
Quote:
"Failed to connect to FTP Server localhost:21"
"There was an error connecting to the server, Please verify the settings are correct."
"Unable to create directory wp-content/uploads/2016/04. Is its parent directory writable by the server?"
How I attempted to resolve the issue: What I found from the searches for solution to the issue, was that, this could be an issue about file permissions. However since I am new to both Linux & WP, I do not know how to give file permissions. And I also I didn’t want to make my system insecure. So I have come the forum to get guidance from knowledgeable people, on the forum.
My issue: Due to my ignorance about Linux, LAMP and WP, I am not sure how to fill the connection information being asked by WP, to connect to my home server, viz; Authentication Keys, Public Key, Private Key, Connection Type [FTP, FTPS(SSL), SSH2].
The information being asked is as given in the image below;
Please forgive my ignorance, I do not know; How to know, whether I am using a FTP or FTPS or SSH connection? What are Authentication, Public and Private Keys?
Kindly help me to fill this information. And please help me resolve these issues. I would appreciate any suggestions by the compassionate, honourable members of the forum, in this regard.
First check whether the upload directories exist and are writable
/PATHTO/INSTALLDRECTORY/wp-content/uploads/2016/04
/PATHTO/INSTALLDRECTORY/wpcontent/uploads
is probably existing. Go with bash to this directory ("cd /path/to/WP/wpcontent/") then
chmod 0666 uploads
As WP seems to be looking for an ftp connection is there an FTP server running? If not you can install an FTP server by
sudo apt-get install pure-ftpd
For FTPS and SSH connections you need a running SSH daemon like open-ssh-server
You can install with the same command as above (replace program name)
To install such programs you need root access to the machine.
Hope this helps
j
During the installation of WP, I had created a folder, 'uploads' in /var/www/html/wp-content/uploads/. I had not created '2016/04' directory. I did it now after your suggestion. I did it as follows. I opened the 'wp-content' folder as root. And opened it in the terminal by right clicking in it and giving the 'mkdir' command.
Now I have the '/var/www/html/wp-content/uploads/2016/04' directory created. And then I went to the 'wp-content' folder by right clicking on it and opening it in terminal. And then I gave the command 'chmod 0666 uploads' as shown below;
Quote:
wp-content # chmod 0666 uploads
wp-content #
Then I checked in the Synaptic to see if 'pure-ftpd' was installed. I found that it is not installed. So I installed it in the synaptic itself, because it would install any dependencies also, as I have enabled the 'Consider recommended packages as dependencies' option in the synaptic preferences.
I am the root and everything went by fine.
And then I opened the Dashboard of WP, and tried to upload images from my computer. But I again recieved the following error;
Quote:
Unable to create directory wp-content/uploads/2016/04. Is its parent directory writable by the server?
Then I tried to update the WP plugins, I opted for the 'akismet' plugin. A page that requires the 'Connection Information' to be filled in, came up. The following boxes were already filled in by default;
Host name:
FTP/SSH username:
FTP/SSH password:
These above information were all filled in by default. I left it as it is. But below that, some information was left blank as below;
Public Key: ?
Private Key: ?
Connection Type: FTP option was checked by default.
With this much information filled in, I clicked on the proceed button. But then I got the following error;
Quote:
Username/Password incorrect
Then I tried to install a new theme. But again I was asked for the same connection information and got the same error.
Yes I have done the configuration. I have created [Copied & renamed 'wp-config-sample.php' file as 'wp-config.php'] and edited the 'wp-config.php' file by changing the default values as below;
Quote:
/** MySQL database username */
define('DB_USER', 'I have changed this to the username I had created while creating the MySQL DB');
/** MySQL database password */
define('DB_PASSWORD', 'I have changed this to the password I had created while creating the MySQL DB');
/** MySQL hostname */
define('DB_HOST', 'localhost');
You have to setup a user for pure-ftpd and use his credentials to connect to the ftp server. By default "root" is not a valid ftp user in pure-ftpd and it is not recommended to use "root" + password of root in ftp.
Actually I would not recommend to use XAMP in a production environment. It is rather an easy-to-use development base.
You have to setup a user for pure-ftpd and use his credentials to connect to the ftp server. By default "root" is not a valid ftp user in pure-ftpd and it is not recommended to use "root" + password of root in ftp.
Actually I would not recommend to use XAMP in a production environment. It is rather an easy-to-use development base.
Thanks j-ray, for the valuable information. From what I am beginning assume is this; I am left with two choices. Either give the server direct control over the directory 'wp-content' by changing folder permissions. Or, create a FTP user and make the server that user, by handing over the username and password of that FTP user account. Am I right?
So now I will have to setup a user for pure-ftpd.
I searched the web for 'how to setup a user for pure-ftpd?'. And I found this link. https://help.ubuntu.com/community/PureFTP. But I have some doubts regarding the suggestions in that link. They are as below;
Should I do exactly as suggested there except changing the username?
In the second section headed 'Security', it is stated that;
Quote:
FTP is by nature a rather unsecure protocol. Add TLS support to prevent your sessions from being vulnerable to man-in-the-middle-attacks
So do I have to carry out those steps too to make a secure connection?
I would suggest to look who owns the wp-content directory and setup this user for pure-ftpd. So check
ls -ls /path/tp/wp-content
That will give out permissions and owner:group
Of course FTP is not a secure protocol. But if you want to use secure protocols you need certifcates and inform yourself about that topic. It is not trivial.
I would suggest to look who owns the wp-content directory and setup this user for pure-ftpd. So check
ls -ls /path/tp/wp-content
That will give out permissions and owner:group
Of course FTP is not a secure protocol. But if you want to use secure protocols you need certifcates and inform yourself about that topic. It is not trivial.
But maybe someone else knows better?
Cheers,
j
Thanks for being there, j-ray.
The permissions and owner:group for wp-content are as below;
The above shows that root is the owner but in your last post you said;
Quote:
Originally Posted by j-ray
....... it is not recommended to use "root" + password of root in ftp.....
Now we find that root is the owner of wp-content and we cannot use "root" + password of root in ftp.
So what is the next alternative course of action, that we need to take?
Is it better to go ahead and create a pure-ftp user?
ak is ak and root is root
if ak has a home directory /home/ak
then you probably can use ak's credentials to connect via ftp to this home directory. So probably you have to configure his access to go to wp-content by default.
ak is ak and root is root
if ak has a home directory /home/ak
then you probably can use ak's credentials to connect via ftp to this home directory. So probably you have to configure his access to go to wp-content by default.
Yes j-ray; ak has a home directory /home/ak.
Then how do I configure his access to go to wp-content by default?
Thanks for being there, j-ray. I greatly appreciate your efforts to help me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.