Thinking about making the switch to Linux...

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

The Ninja Space Goat wrote:do I need a C compiler to install apache? :?
There should be an easy way to install onto your system. At the very least, you should be able to download the source and do

Code: Select all

./configure
make
make test
make install
make clean
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

http://ubuntuguide.org/wiki/Ubuntu_Edgy ... TTP_Server

This guide is usually a one stop resource for all your ubuntu installation questions.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

If you want to compile your own stuff, you will need to install the "build-essential" package.

console: sudo apt-get install build-essential
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

alright I've got php5, apache2 and mysql5 installed now, but when I try to edit the php.ini file, it tells me it's read-only. So I went to the file and tried to change its permissions, but it told me I'm not the owner. Who is? :?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

The Ninja Space Goat wrote:alright I've got php5, apache2 and mysql5 installed now, but when I try to edit the php.ini file, it tells me it's read-only. So I went to the file and tried to change its permissions, but it told me I'm not the owner. Who is? :?
how are you trying to edit the file? You need to be root to do be able to use the GUI to edit files, and by default you will be unable to log in as root. Instead, you insert "sudo" infront of your terminal line commands. Try:

Code: Select all

sudo gedit /etc/php5/apache2/php.ini
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

:-D Thanks... that did the trick.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Remember, Security is like top priority in Linux. Almost anything you want to do that involves the system will require root level admin rights. And make sure the as soon as you are done handling the root level work that you

Code: Select all

#>exit
to get back to your regular user.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

well how do I write all of my php files to my apache server root directory if I don't have write permission on it? I'm confused. :?

Like in my windows set up, I could just open/save/close the files that were in my server's root directory with eclipse... how do I do that in linux?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

sudo <whatever command here>

The first time you do that it asks for a password, subsequent times in the same session do not require a password.

If you really wanted to, you could change the permissions of the webroot too. I always use virtual hosts and make directories under /srv/www/<website> anyway.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

for right now, how do you change the permissions to the webroot? I just spent about 30 minutes trying to set up a virtual host and now I'm just annoyed and getting impatient. I'll have to figure that out another time. :(
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

(as root) chown nickvd.nickvd files

chown <user> . <group> <files>

IIRC ubuntu creates a group for each user the same as their login name.

As your own user: sudo chown nickvd.nickvd files

(sudo: SuperUser DO)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

nickvd wrote:(as root) chown nickvd.nickvd files

chown <user> . <group> <files>

IIRC ubuntu creates a group for each user the same as their login name.

As your own user: sudo chown nickvd.nickvd files

(sudo: SuperUser DO)
Do that as recursive by using the "-R" flag.

You can also create a new group called something like "webmasters" and give that group write permissions to the webroot, then add yourself to the group:

Code: Select all

groupadd webmasters
chgrp -R webmasters /path/to/webroot
chmod -R g+rws /path/to/webroot
usermod -G webmasters <your-username>
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I thought ownership change was delimited by a colon, not a dot (or is the dot acceptable too?).

Code: Select all

chown -R user:group
Another thing you can do too Ninja is get help at the MAN pages by using the 'man' command in conjunction with your command you want information on. And I know on RedHat, I can type the command followed by '--help' to get some more information on that command as well.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Everah wrote:I thought ownership change was delimited by a colon, not a dot (or is the dot acceptable too?).

Code: Select all

chown -R user:group
Another thing you can do too Ninja is get help at the MAN pages by using the 'man' command in conjunction with your command you want information on. And I know on RedHat, I can type the command followed by '--help' to get some more information on that command as well.
Colons and dots work fine. --help, -h and just ignoring passing any arguments are common ways to work out how to do things :)

I will say this: Understanding user permissions, groups and how processes need to run under a certain userid is a fairly big part of understanding your linux system and troubleshooting potential problems.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

yea and one of the biggest reasons for making the switch is to learn all about linux so that when we get a linux box at my work and start hosting our own site, I will know how to administrate it (or at least help administrate it). I should probably learn these things, but for now I need to work on some php stuff so I need to have read/write access to the files and I need to do it the easy way. I fully intend on learning as much as possible about linux and ubuntu, and I thank you guys for being so helpful :D

Although right now linux is strange and difficult for me, I am really enjoying learning about it and I really like it so far. :)
Post Reply