LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 10-27-2007, 12:14 PM   #1
antinull
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Rep: Reputation: 15
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
 
Old 10-27-2007, 12:26 PM   #2
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Rep: Reputation: 15
su then will be asked for the root password.
 
Old 10-27-2007, 12:35 PM   #3
antinull
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Original Poster
Rep: Reputation: 15
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
 
Old 10-27-2007, 12:36 PM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 67
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.
 
Old 10-27-2007, 12:43 PM   #5
antinull
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Original Poster
Rep: Reputation: 15
I feel like a moron.... i have no idea how to do that
BETTER YET!
is it possible for me to use a ftp to access with root permissions?

Last edited by antinull; 10-27-2007 at 12:53 PM.
 
Old 10-27-2007, 01:19 PM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,153

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
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
 
Old 10-27-2007, 01:27 PM   #7
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 67
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:
  1. Log in to the GUI using your normal user
  2. From the menus at the top of the screen, select Applications -> Accessories -> Terminal
  3. enter the command:
    Code:
    sudo -i
  4. Enter your password. Assuming your user is allowed to perform administration activities, the prompt should change to something like:
    Code:
    hostname:~#
  5. 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
  6. Also enter this command:
    Code:
    chgrp -R www-data /var/www
  7. Enter the "exit" command twice. The terminal window should close.
  8. 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.
 
Old 10-27-2007, 01:47 PM   #8
antinull
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Original Poster
Rep: Reputation: 15
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
 
Old 10-27-2007, 02:05 PM   #9
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 67
Quote:
Originally Posted by antinull View Post
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!
 
Old 10-27-2007, 02:18 PM   #10
antinull
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Original Poster
Rep: Reputation: 15
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

Last edited by antinull; 10-27-2007 at 02:21 PM.
 
Old 10-27-2007, 02:51 PM   #11
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 67
Do you mean a little "foot", like this:

http://www.gnome.org/img/logo/text-64.png

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.
 
Old 10-27-2007, 06:16 PM   #12
antinull
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Original Poster
Rep: Reputation: 15
yeah i typoed it was suposed to be a foot not for
okay so im going to go read up on linux permissions
 
Old 10-27-2007, 06:26 PM   #13
antinull
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by matthewg42 View Post
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:
  1. Log in to the GUI using your normal user
  2. From the menus at the top of the screen, select Applications -> Accessories -> Terminal
  3. enter the command:
    Code:
    sudo -i
  4. Enter your password. Assuming your user is allowed to perform administration activities, the prompt should change to something like:
    Code:
    hostname:~#
  5. 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
  6. Also enter this command:
    Code:
    chgrp -R www-data /var/www
  7. Enter the "exit" command twice. The terminal window should close.
  8. 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

Last edited by antinull; 10-27-2007 at 06:47 PM.
 
Old 10-27-2007, 09:13 PM   #14
antinull
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Original Poster
Rep: Reputation: 15
Okay cool its working i finally found a site with a command set that let me edit/delete files (yay)

now the big question
why is apache pointing to http://antinul.com/apache2-default/ instead of http://antinul.com/index.php?
ive searched through the cofigs... i cant seem to find it
 
Old 10-29-2007, 10:21 PM   #15
antinull
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Original Poster
Rep: Reputation: 15
bump for help?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL PHP Apache2 on Debian Stormrage Debian 2 07-16-2006 04:02 PM
Apache2, MySQL & PHP Web Server. FTP Needed! Bobson Linux - Networking 4 02-07-2005 05:25 PM
newbie Extreme - setting up mysql and php on remote server little girl Linux - Software 3 01-19-2004 01:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration