CPANEL root folder deleted - cpanel

By mistake I have deleted the root folder which include public_html, ssl , var and all hidden files because I wanted to take a backup as my previous backup has all these folders.
But now I am not able to access my Wp-Admin.
Can someone tell me what should I do in this case?
I was just playing with wordpress, so if someone can point me to fresh install instead of restore that would also be good.

Recreate the public_html folder from a linux shell console:
mkdir public_html
chmod 750 public_html
chown cpaneluser:nobody public_html
Then restore your files from backup. Be sure that all the files inside the public_html/ folder to have this ownership cpaneluser:cpaneluser (where cpaneluser is your account cpanel username)
If you do not want to restore then be sure you have created the public_html/ folder with the permissions mentioned above and then just reinstall wordpress. You can do that manually using FTP or you can just use Softaculous or any other installer that might be available in your cpanel account.

Related

XAMPP permission denied on all conf files

I want to make some changes to the apache conf file in my xampp application. However, I seem to be unable to alter permissions on the conf files in any way. I only seem to be able to access the conf whenever I mount, but can get permission over the files in any way.
Im running the lates XAMPP version 7.3.2 / PHP 7.3.2 on macOS.
Any ideas?
As I thought, I made a stupid mistake, I installed the XAMPP-VM instead of the normal installation. Switching to non VM obviously fixed it.
I would suggest following method. (Not to compromise the security too much.)
Open Terminal in XAMPP VM
Go to the etc folder
cd /opt/lampp/etc
Change the permission on the conf file.
chmod 777 https.conf
Explore the mounted volume
Open "https.conf" file with any editor you prefer and modify the content.
Change the permission back on the conf file.
chmod 644 https.conf

Kompozer Can't "Publish" web page to my Raspberry Pi Server

I'm not sure how to set the publication settings...
... My RPi is at 192.168.2.126, and is running Apache and ftp.
... The site is to be located in the folder /var/www/GarageDoor on the RPi
... The site is accessed as http://192.168.2.126/GarageDoor/GarageDoors.html
I'm also concerned because my ftp client can't move the file(s) associated with this site directly to /var/www/GarageDoor either. I end up transferring them to my /usr folder, then copying the files manually to the /var/www... folder.
Seems like you need "sudo" permission to copy a file to this folder. I can't figure out how to give either Kompozer or my ftp client such permission. (I'm using bitvise sftp client)
Any ideas would be appreciated.
This sounds a lot like a permissions error. Enter the following into the raspberry pi command line:
sudo chmod 777 /var/www/GarageDoor/GarageDoors.html
Because that would make the file readable by anyone. If that doesn't work, try the +x option to make the file executable.
sudo chmod +x -R /var/www/GarageDoor
Note on the second command: This will make all files in /GarageDoor have executable permissions. (-R is for recursive)

CException Error while deploying yii application on OpenShift?

Friends, I tried to deploy my yii production application from cloud9 IDE to OpenShift while do so, I got this error message,
CException
Application runtime path "/var/lib/openshift/51dd48794382ecfd530001e8/app-root/runtime/repo/php/protected/runtime" is not valid. Please make sure it is a directory writable by the Web server process.
Even when I changed folder permissions to 775 (chmod -R 775 directory) on Cloud9 IDE and deployed again, but I get the same error coming.
It's an old question, but I just bumped into the same issue very recently.
When you extracted the "yii" package several folders were empty, "framework/protected/runtime" was one of them.
To deploy to OpenShift you need to commit the yii package to git, and the push the commit to OS. But, git won't commit empty folders, so they are not created in your deployment. You need to create some file inside those folders and add those files to your git repo before committing/pushing. The usual procedure would be to add a ".gitkeep" file to those folders (it's just a empty dummy file, so git would see those folders).
That would fix this particular error.
It may be due the ownership given to the folder.
Check the web server user group, is that directory is writable or not and also What effects a web server when we change the platform.
Hope my suggestion would be useful.
For Yii applications, the assets and protected/runtime folders are special. First, both folders must exist and writable by the server (httpd) process. Second, these two folders contains temporary files, and should be ignored by git. If these temporary files got committed, deployment in plain servers (not Openshift servers) would cause git merge conflicts. So I put these two folders in .gitignore :
php/assets/
php/protected/runtime/
In my deployment, I add a shell script to be called by openshift, creating both folders under $OPENSHIFT_DATA_DIR and creating symbolic link to both of them in the application's folders. This is the content of the shell script (.openshift/action_hooks/deploy) which I adapted from here :
#!/bin/bash
if [ ! -d $OPENSHIFT_DATA_DIR/runtime ]; then
mkdir $OPENSHIFT_DATA_DIR/runtime
fi
# remove symlink if already exists, fix problem when with gears > 1 and nodes > 1
rm $OPENSHIFT_REPO_DIR/php/protected/runtime
ln -sf $OPENSHIFT_DATA_DIR/runtime $OPENSHIFT_REPO_DIR/php/protected/runtime
if [ ! -d $OPENSHIFT_DATA_DIR/assets ]; then
mkdir $OPENSHIFT_DATA_DIR/assets
fi
rm $OPENSHIFT_REPO_DIR/php/assets
ln -sf $OPENSHIFT_DATA_DIR/assets $OPENSHIFT_REPO_DIR/php/assets
The shell script ensures the temporary folders created on each gear after openshift deployment. By default, a new directory's right are u+rwx, and it became writable by the httpd process because the gear runs httpd as the gear user (not apache or something else).

How to link directory to public_html?

I have ~/public_html and few subdirectories with sites inside. But I have also ~/projects with all my projects (not only websites). I'm trying to link ~/projects/X with ~/public_html/X.
ln -s ~/projects/X ~/public_html/X
But I have error 403, access forbiden. Directory and files into it have rx rights. How should I do that?
You should enable "FollowSymLinks" option for your public_html folder.

Joomla - Warning! Failed to move file error

I have found some solutions to this error and tried implementing them but none of which has worked and hope that some here at SO might have a different answer.
I get this error, "Warning! Failed to move file" when I try install modules into my new installation of Joomla here:
http://sun-eng.sixfoot.co.za
Here's some solutions I have tried to no avail:
http://forum.joomla.org/viewtopic.php?f=199&t=223206
http://www.saibharadwaj.com/blog/2008/03/warning-failed-to-move-file-joomla-10x-joomla-15x/
Anyone know of another solution to this please?
Thanks!
Go to Help -> System Info in your administrator backend and check your Directory Permissions tab to make sure everything is writable.
Also make sure your Path to Temp Folder is correct in Site -> Global Configuration.
Finally, check to make sure that the module isn't already installed. It's possible that some files already got copied or something and now your system is having problems overwriting them.
If none of this works, let us know if the error message specifies which file can't be moved. That would help figure out a solution.
In the configuration folder change the temporal folder location to /tmp (public $tmp_path = '/tmp';) or create your own temperate folder and set it to /myowntemp and change the file permission to 777. you are good to go .
This is typically a file permissions issue. If the system cannot write to the tmp directory within Joomla it will give you the "Warning Failed To Move File" error.
The typical solution is to make the directory wide-open, in general a bad practice but a quick fix. You log in to the Linux command line via a terminal (telnet or ssh) session and set the permissions of the directory.
# chmod -R 777 ./tmp
The better option is to find out what user/group the Apache server is running as and assign the permissions accordingly. For example, if Apache is running your site as the myuser:nobody user:group then you can open up write permissions for the group by changing ownership of the tmp folder and making it writable by anyone in the group:
# chgrp -R nobody ./tmp
# chmod -R 775 ./tmp
Security can be a pain to get set correctly if you don't know *nix commands and security settings, so most people just blast a huge hole in the security with chmod 777.
The next thing you'll probably run into is another error message about not being able to update a specific directory. Again, this is a permissions issue and is typically a piece of the file being unzipped into the administrator subdirectory. Depending on whether your installing a component, a module, or a complex plugin with multiple pieces you may need to open up one or more of these directories using the same approach as above. Here is the "blow a big open hole in security" method:
# chmod -R 777 ./administrator/
Or more selectively:
# chmod -R 777 ./administrator/components/
# chmod -R 777 ./administrator/modules/
If you are a linux user then it is very simple to solve. Just type the following command and try again to install plugin/entension.
sudo chmod -R 777 /var/www/html/my_joomla_folder
You can also refer this link for brief information regarding permission of each folder and file.
Cheers!!
In Joomla 3.x you should go to System->System Information to see directory permissions
If one or more directories that are listed are not "writable" then you should change the permission of those directories:
If you are using one of Linux distributions you can use this command
to give the directories read/write/execute permission:
sudo chmod 777 -R address_of_lampp_directory/lampp/htdocs/joomla_directory
I have had a similar issue today and found is was the permissions set on the 'temp folder'. To resolve I changed them to 777 and my plugin installs worked fine!!
Another thing to check is whether you actually have space on the disk. I had this error and discovered that the drive was 100% full. Removing some unused files fixed the problem.
One other thing to try if everything else is not working is to add the following to your .htaccess file:
php_value upload_max_filesize 10M
Make sure 10M covers the size of the file you are uploading - increase it if your file is 12Mb, for instance.
[Source]
This issue was solved like this.
On the configuration.php file change the tmp_path variable according to:
if you site is mysite.azurewebsites.net, the path should looks like
'C:\DWASFiles\Sites\mysite\VirtualDirectory0\site\wwwroot\tmp'
instead of
'C:\DWASFiles\Sites\mysite.azurewebsites.net\VirtualDirectory0\site\wwwroot\tmp'
Refer to the link: http://social.msdn.microsoft.com/Forums/en-US/windowsazurewebsitespreview/thread/2701eadc-9977-46ab-9c56-81a2234bdce4
I did it and every is working for every error problem with OSX, I use OSX version 10.9.2 and get many problems. The way to fix every error is
# cd /Applications
# chmod -R 777 ./XAMPP
some files might not change permission but the problem is gone.
you can create folder and upload fine and picture, including install plugin.