I've been using xampp to develop on windows with success but as recently I decided to make a change and start developing on Linux. I successfully installed xampp onto my linux machine. and the Apache sever is running "localhost". opt/lampp/htdocs is where Apache project resources are stored. the htdocs folder permission is restricting read and write, and i can't create folders and files to start my projects. I tried change permission for the folders but to no success.
How do i start developing on xampp severe and add files to /opt/lampp/htdocs
please advice ! ! !
cd /opt/lampp
sudo chmod 777 -R /opt/lampp/htdocs `
777 is the permission where you,group and other get all permission -R is any changes will affect in subdirectories and directories of subdirectories htdocs. where adding read=4;write=2 and execute=1 makes it 7.
Related
I'm a newbie in Linux, just installed ubuntu 14.04 and wanted to install WAMP (MAMP), I followed a youtube tutorial to install php5, apache2, mysql and phpmyadmin. Installed successfully both http://localhost and http://localhost/phpmyadmin works fine logged in successfully.
now I wanted to add some files and folders to apache www folder which is located at /var/www but cant create files or folders. I'm a Windows user where I usually keep all my PHP work in www folder.
I would like to know if there is a way to use any-other folder as www folder or how to create folders and files in that www folder. I reckon its permission issues, since being a newbie don't know how to fix that.. please help
Regards
Ubuntu 14.04 runs apache as user www-data, you can change to this user using the command in terminal (shell)
sudo su
This will make you root and have access to /var/www directory, and you will be able to create files and directories. Say you had a directory of images containing img1.jpg, img2.jpg, etc. in say /home/user1/images
as root you could
sudo su <- change to the document folder
cd /var/www <- change to the document folder
cp /home/user1/images/ . <- copy what you need to copy
chown -r www-data images/ <- give the web server read/write permission to the folder / files
which will let you do access the images via a browser via the url
http://localhost/images/img1.jpg
The reason is that apache runs under different user (given your distro most likely www-data), while /var/www belongs either to the user or root.
So if you want to allow apache to write somewhere you have to give it permissions.
Since it is not good practice to give apache full permission to your disk, usually you would have a special directory where it can upload data.
For example creating directory
/var/www/myProject/uploaded
and then giving permission to all to write there
chmod 777 /var/www/myProject/uploaded
Alternatively you can change the owner/group with chown.
I'm on Ubuntu 14.10 .
I copied a subdirectory which has project files (php, html, css) from xampp/htdocs on my Windows PC into /var/www/ of my ubuntu.
However, when I access those files from browser (I can not see the directory listing), I get 402 Object not found. Hence that, I installed Apache2,mysql 5.5 and phpmyadmin and also conducted update apt-get update for the system and I granted chmod-R 777 access to /var/www.
Any idea what might be the problem?
You must put the files on /var/www/html
Then try sudo chmod -R 755 /var/www/html
I am totally new in Linux. I installed Ubuntu 14.04 and installed lamp also phpmyadmin. When I create any file or folder in
var/www/html
that time everything works fine. But when I past any folder or file from wamp that time that file is not working. I don't know the problem . actually I have few projects on wamp and I wanna transfer all project to lamp . now can any-one tell me that how to do it.
thanks in advance
You can give a permission to that folder.
In you command terminal write the following.
//This gives you permission for that folder and all its contents.
sudo chmod -R 777 /www/html Or
Alternatively you can first change to your development directory
cd /var/www
sudo chmod -R 777 html
Hi I just installed ubuntu alongside my Win 7 and I have been using xampp and am very familiar with it, but I just installed lamp and am using the apache2, php, and mysql from terminal and I copied a web folder over from my xampp side and it is saying that I do not have permission to access that file.
I know that on my pc I had some htaccess files but on Ubuntu I am yet to figure out how to view those. Is this a product of those .htaccess files or something else?
That happens if you install WAMP/XAMMP on system partition.
so you copied the files form windows to linux?
sounds like a classic file permissions problem.
per default the www folder is in /var/www, so you can simply set the owner of this folder to the apache user which is called www-data, run this in terminal:
sudo chown -R www-data:www-data /var/www
but now you will no longer be able to write to those files yourself, because they are owned by www-data. checkout this answer for more details and how to get write access: https://askubuntu.com/a/51337
or you make it writeable for everyone (which is a bad idea): sudo chmod -R 777 /var/www
about editing .htaccess files:
I don't use linux with a graphical user interface, but you can edit them with the terminal editor of your choice, on ubuntu you have nano installed by default:
nano /var/www/.htaccess
or if you want a more advanced editor, I suggest vim https://help.ubuntu.com/community/VimHowto
vim /var/www/.htaccess
I installed netbeans with php plugin.I also installed XAMP.My problem is how to configure /opt/lampp/htdocs/ to my netbeans application so that I can debug and run that from the application.Problem is when I try to make a project inside from netbeans it does not allow me to create files on that localhost.I guess netbeans doesn't have write access to the file system. What to do?any help??
Open your UNIX Terminal
Run the sudo chmod 777 /opt/lampp/htdocs command and give sudo your password when prompted
Your htdocs directory should now be rewritable.
You could set up a virtual host to point to your project directory which needs to reside in a directory that is writable. Here's a link to a tutorial for setting up a virtual host using XAMP:
Setting Up Virtual Hosts for XAMPP