I need help setting up my Debian/apache2/php/mysql server
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.
I need help setting up my Debian/apache2/php/mysql server
Okay,
So im at the point where apache works (see http://antinul.com )
I cant edit any thing logged in as a user and debian doesnt let me login as root to the GUI.
so first step
How do i give my user account privilages to access the root priv files?
for example i cant remove any of the files in www or make new ones
no it just says " error while moving cannot move "/var/www/test.php" to the trash because you do not have permissionsto change it or your parent folder"
theres no prompt for root password
On my Debian Etch PPC machine, which lives behind my sofa and use used as a test web server, there is a group www-data which has write access to the web server area, /var/www. I added this group to my regular user's supplemental groups list like this (from a terminal):
Code:
sudo usermod -aG www-data matthew
I believe you will need to log in again with the account you modified for the new supplemental group to be effective.
When I am editing files there I use sg to set my group to www-data and set the umask to 0002. This way, all files I create will be owner matthew, group www-data and have permissions such that other members of the group www-data are able to modify them. Again, I don't know if this is best practise, but it suits my needs in the base of my test server.
theres no prompt for root password ..
... I feel like a moron.... i have no idea how to do that
Anitnull, I do not think you realise that you need to open a terminal (it'll appear as a black window on your desktop, like an old-fashioned DOS screen. It will be in your desktop's menus somewhere (Are you using KDE or Gnome?).
That (the terminal) is where you are asked to type the commands either matthewg42 or KrazyKanuk gave you, and then you press return to execute each one. It is not a GUI, it's a "type commands here" thing, but it's easy really.
I know it feels "old-fashioned", but you really need to learn how to use the terminal, and a simple text editor like nano, or a nice one like vi
Please do this now, or one day you will find your system is "broken" (probably for some very simple and easily-fixable reason), and you will have absolutely no idea how to start fixing it
antinu, here's how to add your regular user to the www-data group, using GUI tools (I am guessing that is what you are most comfortable with). These instructions are for Debian Etch running the Gnome desktop environment. If you are using a different version of debian YMMV:
Log in to the GUI using your normal user
From the menus at the top of the screen, select Applications -> Accessories -> Terminal
enter the command:
Code:
sudo -i
Enter your password. Assuming your user is allowed to perform administration activities, the prompt should change to something like:
Code:
hostname:~#
At this prompt enter the command (note - this is case sensitive. note 2 - replace "yourusername" with your user name):
Code:
usermod -aG www-data yourusername
Also enter this command:
Code:
chgrp -R www-data /var/www
Enter the "exit" command twice. The terminal window should close.
Log out and back in again. Your user now has the ability to edit files and directories which are group-writable by www-data.
You should then be able to modify files in www-data.
If you do not fully understand unix users, groups and permissions, please try to read up on it. If you are running a web server and you don't know this stuff (which is sysadmin 101), your machine will be pwed in no time.
yeah im trying my best lol
i know dos like the back of my hand but the terminal commands are not the same as dos commands so im pretty much lost lol
ill give what you said a try
thanks again
null
yeah im trying my best lol
i know dos like the back of my hand but the terminal commands are not the same as dos commands so im pretty much lost lol
ill give what you said a try
thanks again
null
While the bash (the shell which is used on most Linux systems) may look superficially like the DOS command shell, it is really in a different world. It's like comparing a skateboard to a spaceship Actually - bad analogy - a skateboard is cool!
If you're coming from the DOS side of things (as I did originally), here's a nice bit of info which came as something of a revelation to me:
When you use glob patterns like *.txt, DOS command.com passes this as a literal string to a command like dir. Bash, and other unix shells expand this list first and pass the expanded list of files to the program.
It's well worth learning to use the shell... especially if you are to administrate web servers and similar tasks. It means that a server just has to run ssh, which allows remote terminal login, and then you can remotely administrate lots of servers with ease.
Also, the commands you type on to the terminal are the same ones you use to program shellscript, so if you know how to do something by typing in commands, you can write a program to automate the task. This is extremely useful!
The standard tools which come with most unix and Linux systems seem at first to be a little odd, but they can be combined to perform amazingly complicated and powerful tasks... It's worth learning how to do that. Once you know you'll wonder how you ever managed to get anything done without it!
very awesome ^_^ im going to try some guides and tutorials but my major concern was getting my website back up as my win me server bit the dust (mmm fried ram chips) mysql was to much for it lol
oh yeah i dont know what the gui im using is called? it came with debian 4.0r1 and has the little for in the top right next to the applications menu
If so, that's Gnome. I think it is the default desktop environment for Debian Etch. "Etch" is the name of the release - version 4. The names come from Toy Story - Potato, Woody, Sarge and so on.
antinu, here's how to add your regular user to the www-data group, using GUI tools (I am guessing that is what you are most comfortable with). These instructions are for Debian Etch running the Gnome desktop environment. If you are using a different version of debian YMMV:
Log in to the GUI using your normal user
From the menus at the top of the screen, select Applications -> Accessories -> Terminal
enter the command:
Code:
sudo -i
Enter your password. Assuming your user is allowed to perform administration activities, the prompt should change to something like:
Code:
hostname:~#
At this prompt enter the command (note - this is case sensitive. note 2 - replace "yourusername" with your user name):
Code:
usermod -aG www-data yourusername
Also enter this command:
Code:
chgrp -R www-data /var/www
Enter the "exit" command twice. The terminal window should close.
Log out and back in again. Your user now has the ability to edit files and directories which are group-writable by www-data.
You should then be able to modify files in www-data.
If you do not fully understand unix users, groups and permissions, please try to read up on it. If you are running a web server and you don't know this stuff (which is sysadmin 101), your machine will be pwed in no time.
ok i did this from the root console im going to reboot and try it out
that did not work at all
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.