Litespeed Instance on AWS EC2 Permission Denied But Fixed

sibipaul

Well-Known Member
#1
Hello Sir...

I was trying to Upload Google Webmaster Verification HTML File on My EC2 Server ( Litespeed Wordpress )

Using WinSCP SFTP

Successfully Logged in and View Files & Folders of All Directory.

I Copied the Google verification HTML File and Try to Paste in /var/www/html

But, I was getting an Error

Permission denied
Error Code: 3
Error message from server: Permission denied

So, I understood it because of some permissions, not allow me to upload files remotely.

I searched over google and finally found this solution.

https://forums.aws.amazon.com/thread.jspa?messageID=361659

Code:
sudo chown -R -v ec2-user /var/www/
I Opened Putty and Logged into SSH

Then, I Put This code
Code:
sudo chown -R -v ubuntu /var/www/
after I press enter, then...

this happened.

Check Attached TEXT File to Know What Happened.

This is Too Long, So I Attached as a TEXT File.


After That... I Tried to Upload the Google Verification File into My Site using WinSCP, I Succeeded.

Then I Verified my site in Google Webmaster.


BUT,

I think I have done it in the Wrong Way.

or

I have Opened access to Public

or Something is Not Good for my server...

What is that Command Mean For...?

Did I give permission to upload any files to Anywhere in My server?

I feel something strange.

Can I Change Back to the Previous Condition? ( Default Condition )

How to Do That?

Kindly Check everything and let me know a Proper solution.

NB: I am a little afraid of this... so, I am thinking about removing my EC2 Instance from AWS and set up something new with Familiar Bitnami like software...

This is My First site with Litespeed... so your kind support is highly appreciated.

Thank You So Much.
 

Attachments

Pong

Administrator
Staff member
#2
Do you run LSWS native mode or use any control panel?
If no control panel yet, you might want to consider Cyberpanel so that you don't need to deal with such permission issue since cyberpanel will handle them for you.

In normal condition, you can create user such as "sibipaul" in the system, and make them at /home/sibipaul/, your document root can be /home/sibipaul/public_html/, all folder and files under /home/sibipaul/ will be owned by sibipaul:sibipaul, when you update file through ftp, you should login as "sibipaul" and update/upload/delete files. You will need to configure the site to run PHP as SuEXEC as "sibipaul:sibipaul" instead of nobody:nobody.

If the above seems too overwhelming to you, you can just get a bair Ubuntu server from AWS EC2 or lightsail and reinstall cypberpanel with LiteSpeed then.

https://cyberpanel.net/docs/installing-cyberpanel/
 

Unique_Eric

Administrator
Staff member
#3
Hi @sibipaul

If you launched it from Marketplace. Then those message happens just due to change the whole /var/www/folder owner to ubuntu which is normal.

To correct permission back to normal, please do
Code:
sudo chown -R www-data:www-data /var/www
Let us know if you have more questions.

Best,
Eric
 

sibipaul

Well-Known Member
#4
Yesterday, Just a few minutes after I posted here...

I Open Putty and RUN This Command.


Code:
sudo chown -R -v www-data /var/www/
After that, I have seen some Logs like this

changed ownership of '/var/www/phpmyadmin/vendor/twig/twig/src/Node/SetTempNode.php' from ubuntu to www-data

I think, now I have the default things.

is it Correct?

When UBUNTU was in the role, I was able to copy the file to the directory using WIN SCP

now, ubuntu to www-data

now I tried to Copy, then I am getting the permission error message.

If I have reverted everything as before, then I am happy... ( Actually, I don't know what is now in the system )
 

sibipaul

Well-Known Member
#5
Do you run LSWS native mode or use any control panel?
If no control panel yet, you might want to consider Cyberpanel so that you don't need to deal with such permission issue since cyberpanel will handle them for you.

In normal condition, you can create user such as "sibipaul" in the system, and make them at /home/sibipaul/, your document root can be /home/sibipaul/public_html/, all folder and files under /home/sibipaul/ will be owned by sibipaul:sibipaul, when you update file through ftp, you should login as "sibipaul" and update/upload/delete files. You will need to configure the site to run PHP as SuEXEC as "sibipaul:sibipaul" instead of nobody:nobody.

If the above seems too overwhelming to you, you can just get a bair Ubuntu server from AWS EC2 or lightsail and reinstall cypberpanel with LiteSpeed then.

https://cyberpanel.net/docs/installing-cyberpanel/

I have AWS Account

Installed EC2 Instance by going Marketplace

and Selected WordPress Powered by Litespeed

Configured EC2 Instance ( I am totally new to AWS and Litespeed - ( https://www.litespeedtech.com/suppo...-in-aws-wordpress-package-by-litespeed.17688/ )

So Much Interested to Learn these things... :)

What do I want to do now?

Need to RUN an error-free, user-friendly atmosphere.

if Cyberpanel is required to RUN EC2 & LiteSpeed smoothly, Then I am ready to Install... Help me how to do it.

if this Litespeed is easy to configure like old school Cpanel, then I am really Interested to move all the websites managed by me.
 

Unique_Eric

Administrator
Staff member
#6
Hi ,

Generally, you access your server with your key or password. Then copy files in to the place you want. If you want to put it under /var/www/, e.g. /var/www/123.html, then you may want to change the user/group to www-data so that web server can read it with right permission. To make it works, just run ` sudo chown -R www-data:www-data /var/www/123.html` to change this file's ownership.

Better launch images that come with control panels if you want to manage multiple sites, should be easier to manage.

Please give it some test first by yourself before moving your sites to any control panels. ;)

Best
 

sibipaul

Well-Known Member
#7
Hi ,

Generally, you access your server with your key or password. Then copy files in to the place you want. If you want to put it under /var/www/, e.g. /var/www/123.html, then you may want to change the user/group to www-data so that web server can read it with right permission. To make it works, just run ` sudo chown -R www-data:www-data /var/www/123.html` to change this file's ownership.

Better launch images that come with control panels if you want to manage multiple sites, should be easier to manage.

Please give it some test first by yourself before moving your sites to any control panels. ;)

Best

Now My AWS EC2 Instance is Loaded with WP Powered by Litespeed - https://aws.amazon.com/marketplace/pp/B07KSC2QQN

I did not perform any settings by me - the things what I have done extra - you can see here and my previous thread.

Managing a Server with Control Panel is very easy - as you said.

So, tell me how can I install Cyberpanel into my existing Litespeed WordPress EC2 Instance?

is it possible by this method? - https://cyberpanel.net/docs/installing-cyberpanel/

Just RUN the Command in putty as seen in the URL?
 

sibipaul

Well-Known Member
#9
So, You have two options...

1 - Install it through putty commands on my Exisiting wordpress install

2 - a fresh installation with new server.

which is best for optimized perfomance?

fresh installation included the OS + CyberPanel + Lightsleed + Wordpress + Cache + Optimized Configurations ?
 

sibipaul

Well-Known Member
#10
My Primary Focus is

Performance ( I am mad on this )

I entered in this server game Only because of this Optimization in a WordPress Site.

Now, whenever I install a Site, I check its Performance Just after my configurations...

I am the Guy, :)

I will be happier if a Site Loads in 50ms :)
 

Unique_Eric

Administrator
Staff member
#11
1. Install it through putty commands on a pure centos or ubuntu server instead of your existing wordpress server
2. Launch the Cyberpanel image from marketplace

I believe Cyberpanel includes CyberPanel +OpenLiteSpeed + 1 click wordpress + LScache
 

sibipaul

Well-Known Member
#12
my site is www.flowerwase.com

it's purely new... just started with AWS

Just Installed Litespeed Wordpress from Marketplace.

but still, in this scenario... you are saying... the Best Option for a Long Durable RUN... is

Remove the current EC2

and Launch a New EC2 for this Domain.

while Launching, I can Choose 2 Options

1 - Install Ubuntu or Cent OS from AWS Market Place - Then Install Cyber Panel Through SSH Commands, After Cyber Panel Successful installation.,

login, and Install Litespeed and Wordpress.

2 - Simply Launch a New EC2 Server without selecting an OS, and Just Choose Cyber Panel from AWS Marketplace. and the Installation may contain everything which I needed to RUN a Wordpress Site.

Correct?

So My Question is...

for the Best Durable Performance and to avoid bugs... I Must Remove the current EC2 and Install or SETUP a New server... I am totally OK with that.

When Performance is My primary Motto, I am ready to Go with any sacrifice...

My question is,

from the Two Options,

Which One is the Best.
 

Shivam

Member
Staff member
#13
Hi @sibipaul ,

I read all your messages, and since you're definitely not a seasoned system admin this is what I would suggest you do.

Step 1 - Take a backup of your current website if you need it.
Step 2 - Delete the current EC2 Instance.
Step 3 - Create a new EC2 instance with CentOS 7 installed on it(You'll find this OS on Amazon's marketplace)
Step 4 - Login to your Webserver as centos user and use su - command to change your user to root.
Step 5 - Run yum -y update command on your server.
Step 6 - Install Cyberpanel using the following instructions - https://cyberpanel.net/docs/installing-cyberpanel/ (Its just that one command under the heading Installing CyberPanel!)
Step 7 - Create a Website in Cyberpanel - https://cyberpanel.net/docs/2-creating-website/
Step 8 - Install Wordpress on it, You'll see that option on Cyberpanel after you create the website.
Step 9 - Restore your Wordpress Backup, If you took one.
Step 10 - Install/Verify Litespeed Cache Plugin.
Step 11(Optional But good for performance) - Follow the guide here to Optimize your Wordpress using Litespeed Cache - https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:beginner

Let us know if you have any questions :)
 

sibipaul

Well-Known Member
#14
OMG, I can't believe this... :eek:

This is what I'm expecting from this Forum :p

1 - How to Take a Back up?

2 - Can you please Make the 4th step easier

3 - after installing Cyber Panel - How to Open it in Browser? - Cyber Panel Opening through IP or it Needs to Connect with a Domain? ( Silly Question - but it means a lot to me )

4 - Restoring Previous back up or set up new fresh in a new server, which is actually good...

My Site is https://www.flowerwase.com/ there is nothing special just some UI color changes...

So Installing New, and configure again ... is good? ... to avoid restore backup headache...?
 

Shivam

Member
Staff member
#15
OMG, I can't believe this... :eek:

This is what I'm expecting from this Forum :p

1 - How to Take a Back up?

2 - Can you please Make the 4th step easier

3 - after installing Cyber Panel - How to Open it in Browser? - Cyber Panel Opening through IP or it Needs to Connect with a Domain? ( Silly Question - but it means a lot to me )

4 - Restoring Previous back up or set up new fresh in a new server, which is actually good...

My Site is https://www.flowerwase.com/ there is nothing special just some UI color changes...

So Installing New, and configure again ... is good? ... to avoid restore backup headache...?
1 - Use any Wordpress Plugin, Initial Google Searches lead me to this -
https://wordpress.org/plugins/updraftplus/
https://wordpress.org/plugins/backwpup/

2 - 4th Step is actually not hard at all, Just like you're logging in as "ubuntu" currently, when you install CentOS, You'll login with "centos", then just run su - in your SSH terminal(like Putty) and proceed further with next step.

3 - Cyberpanel can be accessed on https://IP:7080, Replace IP with your actual AWS EC2 Instance IP.

4 - It's definetely fine if you want to continue without a backup and rebuild Wordpress instead.
 

sibipaul

Well-Known Member
#16
Hi @sibipaul ,

I read all your messages, and since you're definitely not a seasoned system admin this is what I would suggest you do.

Step 1 - Take a backup of your current website if you need it.
Step 2 - Delete the current EC2 Instance.
Step 3 - Create a new EC2 instance with CentOS 7 installed on it(You'll find this OS on Amazon's marketplace)
Step 4 - Login to your Webserver as centos user and use su - command to change your user to root.
Step 5 - Run yum -y update command on your server.
Step 6 - Install Cyberpanel using the following instructions - https://cyberpanel.net/docs/installing-cyberpanel/ (Its just that one command under the heading Installing CyberPanel!)
Step 7 - Create a Website in Cyberpanel - https://cyberpanel.net/docs/2-creating-website/
Step 8 - Install Wordpress on it, You'll see that option on Cyberpanel after you create the website.
Step 9 - Restore your Wordpress Backup, If you took one.
Step 10 - Install/Verify Litespeed Cache Plugin.
Step 11(Optional But good for performance) - Follow the guide here to Optimize your Wordpress using Litespeed Cache - https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:beginner

Let us know if you have any questions :)
Why CentOS Recommended... does it have an advantage than Ubuntu?
 

sibipaul

Well-Known Member
#18
Hi @sibipaul ,

I read all your messages, and since you're definitely not a seasoned system admin this is what I would suggest you do.

Step 1 - Take a backup of your current website if you need it.
Step 2 - Delete the current EC2 Instance.
Step 3 - Create a new EC2 instance with CentOS 7 installed on it(You'll find this OS on Amazon's marketplace)
Step 4 - Login to your Webserver as centos user and use su - command to change your user to root.
Step 5 - Run yum -y update command on your server.
Step 6 - Install Cyberpanel using the following instructions - https://cyberpanel.net/docs/installing-cyberpanel/ (Its just that one command under the heading Installing CyberPanel!)
Step 7 - Create a Website in Cyberpanel - https://cyberpanel.net/docs/2-creating-website/
Step 8 - Install Wordpress on it, You'll see that option on Cyberpanel after you create the website.
Step 9 - Restore your Wordpress Backup, If you took one.
Step 10 - Install/Verify Litespeed Cache Plugin.
Step 11(Optional But good for performance) - Follow the guide here to Optimize your Wordpress using Litespeed Cache - https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:beginner

Let us know if you have any questions :)
I Launched EC2 Instance CentOS 7

Logged in to SSH

Step 4 su - , when I enter that in Putty...

Next Line

Code:
[centos@ip-172-31-31-9 ~]$
[centos@ip-172-31-31-9 ~]$ su -
Password:
is showing like this...

I am unable to type anything, it stocks, then I need to close putty ... to log in again...

What to do..?
 

sibipaul

Well-Known Member
#19
I tried a few passwords

root

centos

1234

admin

password

all that is failed to login, and reply as authentication failed...

anyone can help me to find the default password of AMI installed CentOS 7 ?
 
Top