Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963
Rep:
www-data
Hi all
I know this question has come up so many time's
any one care to point me to a fix to get this issue fixed, I've reinstalled my system ( Ubuntu 9.10 command line server ) server is next to me on the floor, I use another PC Ubuntu desktop 9.10 to gain access
I have installed a LAMP server with vsftpd, ssh, imagemagick, php5-gd, I'm planning on running on this server Joomla, Wordpress, Gallery, webmin
the only user that has been added is the admin user when you frist install the system, and sudo has not yet been changed, I use sudo for access to root as in sudo apt-get update
All i want to do is use a FTP program like gFTP or a win app on wine called winscp to upload files to /var/www to be able to run my site
So is there any fix to this problem that alot of people seem to be having I would love to know
Create a webdev user on the server; use scp (part of ssh pkg) to txmit files from the client to the server on that user eg
client:/home> scp file webdev@server:/home
If you add webdev user to the same group as the owner of var/www/ eg apache then add group write access to that dir path, the webdev user will be able to copy from his home dir to the /var/www. In fact, you should be able to scp direct from the client system to that dir as webdev user.
Don't know if Ubuntu has SELinux service; if so you may(?) have to change the context as well, but let's try the above first.
You have apache installed.
Why not make use of that fact and change the directory for the web root. (default site)
As admin, create directories in admins home directory like the following
www
www/html
www/cgi-bin
Make sure they all have permissions of 755
edit /etc/httpd/conf/httpd.conf as root
find the line
Code:
DocumentRoot "/var/www"
and change it to
Code:
DocumentRoot "/home/admin/www/html"
a bit further down you will find
Code:
<Directory "/var/www">
change that to
Code:
<Directory "/home/admin/www/html">
If you want to run cgi scripts go down until you find
Code:
ScriptAlias
and make it like
Code:
ScriptAlias /cgi-bin/ "/home/admin/www/cgi-bin/"
also a bit further down change the <Directory> line to read
Code:
<Directory "/home/admin/www/cgi-bin">
None of the lines you are changing should have # in front of them.
When you've done all those lines, save the file and restart apache.
You can now login over ftp using admin as the user name and whatever admins password is.
It doesn't have to be admin. It can be any user you want to create for the purpose. Just replace admin with the correct user name in the above instructions.
If you want to access the web server by another domain name (separate site) then you have to add a virtual host to httpd.conf with that domain name.
There are examples in the file. The default site is the one that will come up if you don't specify a virtual site.
Technically, every user on the server could have their own web site and domain names.
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963
Original Poster
Rep:
Quote:
Originally Posted by smoker
You have apache installed.
Why not make use of that fact and change the directory for the web root. (default site)
As admin, create directories in admins home directory like the following
www
www/html
www/cgi-bin
Make sure they all have permissions of 755
edit /etc/httpd/conf/httpd.conf as root
find the line
Code:
DocumentRoot "/var/www"
and change it to
Code:
DocumentRoot "/home/admin/www/html"
a bit further down you will find
Code:
<Directory "/var/www">
change that to
Code:
<Directory "/home/admin/www/html">
If you want to run cgi scripts go down until you find
Code:
ScriptAlias
and make it like
Code:
ScriptAlias /cgi-bin/ "/home/admin/www/cgi-bin/"
also a bit further down change the <Directory> line to read
Code:
<Directory "/home/admin/www/cgi-bin">
None of the lines you are changing should have # in front of them.
When you've done all those lines, save the file and restart apache.
You can now login over ftp using admin as the user name and whatever admins password is.
It doesn't have to be admin. It can be any user you want to create for the purpose. Just replace admin with the correct user name in the above instructions.
If you want to access the web server by another domain name (separate site) then you have to add a virtual host to httpd.conf with that domain name.
There are examples in the file. The default site is the one that will come up if you don't specify a virtual site.
Technically, every user on the server could have their own web site and domain names.
Hey Smoker, I'm just getting into it now, this path
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963
Original Poster
Rep:
Quote:
Originally Posted by chrism01
Create a webdev user on the server; use scp (part of ssh pkg) to txmit files from the client to the server on that user eg
client:/home> scp file webdev@server:/home
If you add webdev user to the same group as the owner of var/www/ eg apache then add group write access to that dir path, the webdev user will be able to copy from his home dir to the /var/www. In fact, you should be able to scp direct from the client system to that dir as webdev user.
Don't know if Ubuntu has SELinux service; if so you may(?) have to change the context as well, but let's try the above first.
what do you mean by webdev, I haven't heard of that term before
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963
Original Poster
Rep:
Smoker, it did work, but I now have lost awstats and webalizer as well, I know you have tried to help, but I would rather try and get my user to upload to the original path instead ( /var/www )
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963
Original Poster
Rep:
I see
I've reset apache2 back to /var/www
the group that has that path is www-data and its group is www-data going by details in webmin
My only user which is admin, EG: my nick has the same group as the nick EG: tommytomato
I've tried before to add tommytomato to the www-data group and I wasn't able to write to the directory and tommytomato home directory is /home/username
Basically, apache installs as someuser:somegroup. This varies on different distros and I don't have Ubuntu.
If you go from a fresh install of apache, you can do
ls -l /var/www
to see what the default ownership & group is. As I said, no need to allow apache to write to those dirs (for security). Add an acl to allow your user to write there.
If you
acl is that like so ? I did try this 2 days ago with NO luck
Quote:
Originally Posted by sayan_acharjee
I mean you need to create an access control list for the user allowing it to to read-write-execute in the directory, I am not talking about the usual chmod driven permission.
Here is how you can do this:
edit the /etc/fstab file in the following manner:
The mount point can be different depending on the way your system is partitioned, if the /var partition is mounted somewhere else then you need to edit that line by putting ,acl option after defaults.
Then remount that partition:
Post #30 on that page shows how to setup the partition for acls; except use the acl format of mine above. It ensures that all files/dirs get acl set (d = default). Read that man page link of mine first.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.