LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 04-04-2016, 10:59 PM   #1
Anil Kagi
Member
 
Registered: Aug 2014
Distribution: antiX-Frugal
Posts: 155

Rep: Reputation: 0
WordPress cannot get access to my LAMP server.


Hello there.

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;

Click image for larger version

Name:	Connection dialogue box.png
Views:	83
Size:	40.4 KB
ID:	21380

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.

Thank you

Regards
 
Old 04-05-2016, 03:36 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
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

Last edited by j-ray; 04-05-2016 at 03:38 AM.
 
Old 04-05-2016, 08:15 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,349
Blog Entries: 28

Rep: Reputation: 6147Reputation: 6147Reputation: 6147Reputation: 6147Reputation: 6147Reputation: 6147Reputation: 6147Reputation: 6147Reputation: 6147Reputation: 6147Reputation: 6147
Did you configure the file, wp-config.php per instructions (see step three at the link)?
 
1 members found this post helpful.
Old 04-06-2016, 01:34 AM   #4
selenaz
LQ Newbie
 
Registered: Apr 2016
Posts: 5

Rep: Reputation: 0
not acces of lamp

i am php developer with nearly 3 yrs of exp. .. i will recommend you to use xampp .. which best and can be use use on any window..
 
Old 04-07-2016, 02:41 AM   #5
Anil Kagi
Member
 
Registered: Aug 2014
Distribution: antiX-Frugal
Posts: 155

Original Poster
Rep: Reputation: 0
Thank you j-ray, for coming.

Quote:
Originally Posted by j-ray View Post
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.

Thank you j-ray, for trying to help me.

Regards
 
Old 04-07-2016, 02:44 AM   #6
Anil Kagi
Member
 
Registered: Aug 2014
Distribution: antiX-Frugal
Posts: 155

Original Poster
Rep: Reputation: 0
Thank you frankbell, for coming.

Quote:
Originally Posted by frankbell View Post
Did you configure the file, wp-config.php per instructions (see step three at the link)?
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');
Thank you frankbell, for the concern.

Regards
 
Old 04-07-2016, 02:51 AM   #7
Anil Kagi
Member
 
Registered: Aug 2014
Distribution: antiX-Frugal
Posts: 155

Original Poster
Rep: Reputation: 0
Thanks for coming, selenaz.

Quote:
Originally Posted by selenaz View Post
i am php developer with nearly 3 yrs of exp. .. i will recommend you to use xampp .. which best and can be use use on any window..
You mean un-install LAMP and install XAMP?

Thanks for the concern.

Regards
 
Old 04-07-2016, 03:00 AM   #8
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
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.
 
Old 04-08-2016, 03:13 AM   #9
Anil Kagi
Member
 
Registered: Aug 2014
Distribution: antiX-Frugal
Posts: 155

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by j-ray View Post
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?

PLease kindly suggest what I should do.

Thank you

Regards
 
Old 04-08-2016, 05:24 AM   #10
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
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
 
Old 04-08-2016, 10:28 AM   #11
Anil Kagi
Member
 
Registered: Aug 2014
Distribution: antiX-Frugal
Posts: 155

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by j-ray View Post
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;

Click image for larger version

Name:	WP-content Owner.png
Views:	73
Size:	23.0 KB
ID:	21413

The above shows that root is the owner but in your last post you said;

Quote:
Originally Posted by j-ray View Post
....... 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?

Thank you

Regards

Last edited by Anil Kagi; 04-08-2016 at 10:32 AM.
 
Old 04-08-2016, 12:25 PM   #12
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
ak is the owner not root
 
Old 04-09-2016, 12:11 AM   #13
Anil Kagi
Member
 
Registered: Aug 2014
Distribution: antiX-Frugal
Posts: 155

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by j-ray View Post
ak is the owner not root
j-ray,

ak is also the root. Now can I setup this user for pure-ftpd? If yes, how to setup this user for pure-ftpd?

Thanks for staying with me.

Regards
 
Old 04-09-2016, 08:58 AM   #14
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
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.
 
Old 04-09-2016, 10:04 PM   #15
Anil Kagi
Member
 
Registered: Aug 2014
Distribution: antiX-Frugal
Posts: 155

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by j-ray View Post
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.

Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Installed LAMP & WordPress, locally on LinuxMnint17.3 successfully, but I am unable to login. Anil Kagi Linux - Newbie 26 04-03-2016 10:55 PM
LXer: How To Install Wordpress On Ubuntu 14.04 LAMP LXer Syndicated Linux News 0 08-26-2014 10:50 AM
[SOLVED] Setting up basic lamp server with CentOS 6, opinions for developer access? jraz Linux - Server 4 11-27-2011 07:42 AM
lamp wordpress loopback url freakout ninja master Linux - Networking 1 04-27-2011 09:22 PM
Apache: You don't have permission to access /wordpress/ on this server. IKT Linux - Server 18 08-20-2009 07:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration