LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 09-24-2004, 08:58 PM   #1
dramous
LQ Newbie
 
Registered: Sep 2004
Posts: 13

Rep: Reputation: 0
apache server setup and how to place files in the var/www/html directory


I am new to linux, but i have a great understand if some one would direct me in the right path, My problem is correctly setting up the apache software and know how to place the files into the var/www/html folder.

My server will be a standalone system that will host a single site that will run php, cgi, and run a mysql database. I need the exact syntax on setting it up under this situation. also how to place my pages in the html folder. Please help
i am running enterprise linux 2.1
Andre'
 
Old 09-25-2004, 10:13 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,415

Rep: Reputation: 99
if u want to move files or directories u need to run
'mv /path/to/file /new/path/file'
'man mv'
will tell u more

cgi files should be made executable
chmod 0755 /path/perlfile.pl
other files should be readable
'man chmod'
will tell u more

apache comes with a detailed documentation. if u start the server u find the documentation by default here:
http://localhost/manual
the config file of apache is called httpd.conf. probably u can find it at
/etc/httpd
if not run
'locate httpd.conf'
that should give u the address
cheers, j.
 
Old 09-25-2004, 10:13 AM   #3
hob
Senior Member
 
Registered: Mar 2004
Location: Wales, UK
Distribution: Debian, Ubuntu
Posts: 1,075

Rep: Reputation: 45
Apache supports CGI and PHP by default, so you don't need to configure anything for these. You do need to make sure that you have the php packages installed, but I think that the basic PHP package installed by default.

MySQL will not start until you have set a root password (for it's administration account, which is called 'root'). MySQL usernames are in the form username@hostname, so root@localhost and root@myserver.mydomain.com are separate accounts. This can be difficult to understand and causes problems if you make a mistake at the start, so take a look at the documentation on managing accounts at mysql.com before you go ahead. You don't need to configure anything else to make MySQL work.

/var/www/html is a standard directory. You can access it directly using the system 'root' account, but it is best to enable access through WebDAV or FTP services, which can enable access by username/password.

Red Hat provide a very good set of documentation, which you can download for free from their site (RHN has an ISO file for a Documentation CD as well). The sections on Apache will cover the essentials. Your Apache server includes reference documentation as well - try http://localhost/manual once you have started the server.

Please take your time and read the documentation before working on Apache and MySQL - unfortunately Linux has no safety mechanisms to prevent you from accidently wrecking the security whilst trying to make things work.
 
Old 09-26-2004, 11:17 AM   #4
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,415

Rep: Reputation: 99
Apache supports CGI and PHP by default,

thats not true. php has to be installed separately and added as a module to apache.
 
Old 09-26-2004, 02:52 PM   #5
hob
Senior Member
 
Registered: Mar 2004
Location: Wales, UK
Distribution: Debian, Ubuntu
Posts: 1,075

Rep: Reputation: 45
Hmm. I don't remember having to do anything to set up PHP, although this was on RH Enterprise 3.0.
 
Old 09-27-2004, 01:02 PM   #6
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,415

Rep: Reputation: 99
well i dont know rh and fedora but on suse u just have to install the rpms of apache and php to get php going. but without a distribution that takes care of that u have to read the install instructions and edit httpd.conf a bit and so on...
its not too difficult.
cheers
 
Old 09-28-2004, 03:34 AM   #7
hob
Senior Member
 
Registered: Mar 2004
Location: Wales, UK
Distribution: Debian, Ubuntu
Posts: 1,075

Rep: Reputation: 45
I have heard that some other distributions disable PHP in the httpd.conf file for security.

SUSE and Red Hat might not do this, so PHP is enabled as long as the RPM has been installed.

On Red Hat you can start the Apache service without even looking at the configuration. This is a bit dangerous, because it's tempting to just put some files in /var/www/html and start the service without thinking about the security of the system. In particular, SSL is something you should set up before you make the system live on the Internet. This is covered in the Red Hat Enterprise docs, which is one of the reasons I recommended doing the reading before going ahead.
 
Old 09-28-2004, 04:18 AM   #8
Kess78
Member
 
Registered: Jul 2004
Location: Switzerland
Distribution: Debi@n, SuSE
Posts: 36

Rep: Reputation: 15
Hi, all you say depends on the distribution you're using.
I know, RH and Fedora installs PHP by default when you install apache but debian, slackware, SuSE don't do so.
SSL is never activated by default, you must install openssl and generate your certificate/(s) before you can enable ssl by setting up thes start parameter '-D SSL'
Generally (but not always) when you install an apache module it's by default enabled in httpd.conf. In some cases (SuSE) you have to edit /etc/sysconfig/apache or /etc/sysconfig/apache2 to add your module in the enabled module list.

For MySQL you have to install it.
After MySQL installation run the following:
mysqladmin -u root -p password 'newpassword' (you will be asked for the old password, generally 'blank')
mysqladmin -u root -h <type your host name here> -p password 'newpassword' (you will be asked for the old password, generally 'blank')

You have to do it twice because the user root@localhost and the user root@your_host_name are 2 different users, I know that it's difficult to understand but that's how mysql works.

If you don't know how mysql command line works, install mysqlcc (MySQL GUI) or phpMyAdmin (Web admin to mysql written in php). This will help you for your db administration.

Hope this helps, bye Kess...
 
  


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
Directory index forbidden by rule: /var/www/html/ danimaldaisy Linux - Networking 6 02-11-2008 01:32 AM
apache server setup and how to place files in the var/www/html directory dramous Linux - Software 3 09-25-2004 02:38 AM
apache server setup and how to place files in the var/www/html directory dramous Linux - General 2 09-25-2004 01:29 AM
how to setup ftp user's diretory as /var/www/html lzyking Linux - Software 4 02-25-2003 12:58 PM
Giving a user CHMOD rights to the /var/www/html directory? scubes13 Linux - Networking 3 08-18-2002 03:38 PM


All times are GMT -5. The time now is 11:06 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration