Accidently deleted files in cPanel home directory - wordpress

I just wanted to delete the files under the public_html folder. But accidentally I deleted all the files under the home directory, like- etc, logs, mail, public_html, public_ftp, ssl, tmp, www. I have no backup. Now, I just created the public_html folder and put the WordPress files. When I browse the site, it says ---
"Forbidden
You don't have permission to access this resource. Server unable to read htaccess file, denying access to be safe
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request."
Could you please help me out? I'm so much confused.

if you are using shared hosting contact your hosting provider they might have a backup for your full /home directory and they can restore if from their end with the latest backup available.
if you are running a dedicated VPS I am not sure how it should be accessed

Related

WP-INCLUDES folder returning error 403

I have a website on WordPress with SSL installed through Cloudflare. My server has a Windows/IIS operating system.
I have a issue on the WP-INCLUDES folder returning error 403 with several WordPress and Template functions not working.
I would like to know if any of you guys know how to fix this issue and could help me. I’ve already set all permissions on IIS but without success.
If you need more details you can check the website on www.sospdf.com.br.
Thank you very much.
What are you trying to do with the wp-includes folder? I believe it is common for wp-includes to be forbidden as it can be a security liability. If you're changing something in the wp-includes folder you may want to do this through SFTP.
If pages other than /wp-includes/ are returning 403 or forbidden here are some of the most common causes:
1.) 403 caused by a wordpress plugin, particularly a poorly configured security plugin. Deactivate plugins and reactivate one at a time
2.) Corrupt .htaccess file. Download your .htaccess file via FTP so you have a back up copy. Delete .htaccess from your server and then generate a new
.htaccess by logging into your theme admin and going to settings >> permalinks
3.) Check file permissions (which is seems like you did)
More information on the rationale behind why it might be better for your WP-INCLUDES folder to return 403 can be found in the Wordpress Codex on hardening wordpress in the WP-INCLUDES section.

WordPress Admin Loging 404 Error re .htaccess

I've a WordPress site hosted on OpenShift and I can't access my admin login page. When going to the /wp-admin or /wp-login.php pages I get a 404 / "page not found" error.
WordPress forum suggestions have advised deleting the .htaccess file at the app's root and the app shout reset the file granting me access. Because OpenShift uses a different directory structure, I can't find the correct .htaccess file specific to WordPress.
Can anyone advise?
Your .htaccess file should still be located with the core wordpress files, are you accessing the server via sftp? Are you viewing hidden files?
Should be located in /app-root/data/current/

Wordpress Can not create directory

I am trying to upload a new theme to my WordPress site
I get an error "Can not create directory"
Im sure its permissions errors however I cannot figure out what to do.
I have setup a new server (CentOS), I have all the ports open needed for FTP.
I can ftp from a different location through telnet.
My ftp user has full permissions to the directory.
How can i fix this?
From the File Permissions section of Hardening WordPress:
All files should be owned by your user account, and should be writable by you. Any file that needs write access from WordPress should be writable by the web server, if your hosting set up requires it, that may mean those files need to be group-owned by the user account used by the web server process.
/
The root WordPress directory: all files should be writable only by your user account, except .htaccess if you want WordPress to automatically generate rewrite rules for you.
/wp-admin/
The WordPress administration area: all files should be writable only by your user account.
/wp-includes/
The bulk of WordPress application logic: all files should be writable only by your user account.
/wp-content/
User-supplied content: intended to be writable by your user account and the web server process.
Within /wp-content/ you will find:
/wp-content/themes/
Theme files. If you want to use the built-in theme editor, all files need to be writable by the web server process. If you do not want to use the built-in theme editor, all files can be writable only by your user account.
/wp-content/plugins/
Plugin files: all files should be writable only by your user account.
You wouldn't go wrong by reading the entire Hardening WordPress page, really.

Wordpress Forbidden Update Pages

I already tried to look for some solutions about this, but i didn't find any.. Maybe you guys can solve my problem.
I can't update my Wordpress page
Forbidden
You don't have permission to access /demo/myfolder/wp-admin/post.php on this server.
Apache Server at www.my-site.com Port 80
some say to delete my .htaccess file and refresh the page. that didn't work..
Right now here's the content of my .htaccess file
# BEGIN WordPress
# END WordPress
I also tried "wp-admin and right click on the very folder, give permission 777"
Internal Server Error File "/var/www/vhosts/my-site.com/httpdocs/demo/myfolder/wp-admin/post.php" is writeable by group suPHP 0.7.1
Thanks
If you have ftp access go to wp-admin and right click on the very folder, give permission 777 (if you are using Filezilla).
777 permissions are unnecessary and very insecure. See the docs at WordPress.org Changing File Permissions « WordPress Codex for the correct file/folder permission structures and how to change them with an FTP client.
If that doesn't work, ask your webhost.

Will Deploying Git via Beanstalk affect WordPress Upload Directory Permissions?

I've got a WP site in a workflow that goes local--> git (beanstalk) --> dev server.
Everything seems to be working fine when I deploy, but I've noticed that I can't upload images via WP and it seems like it's a directory permission issue.
The error I get is: "The uploaded file could not be moved to /path/blah/blah...
Is this because the FTP user doesn't 'own' these directories/files (because they weren't created via the WP site / FTP account of the dev server?
Please let me know if you've got any brilliant work-arounds or insights. I'm stumped.
Thanks in advance.
This is because Beanstalk uses ftp to upload your files, that means the owner becomes the FTP user. If Wordpress then wants to access those files, it is no owner so it can't delete/alter them. You can use chown apache <filename> on SSH if you want to make apache (wordpress) owner again. But now Beanstalk can't overwrite the files for the same reason.
The way to go is use a .gitignore file to ignore folders like uploads and cache. You don't need them locally for development, if you do, just grab them once with ftp.
I use this one myself with some additions. It may seem weird at first, but it rocks when it all works. :)

Resources