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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
09-24-2004, 08:58 PM
|
#1
|
LQ Newbie
Registered: Sep 2004
Posts: 13
Rep:
|
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'
|
|
|
09-25-2004, 10:13 AM
|
#2
|
Senior Member
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591
Rep:
|
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.
|
|
|
09-25-2004, 10:13 AM
|
#3
|
Senior Member
Registered: Mar 2004
Location: Wales, UK
Distribution: Debian, Ubuntu
Posts: 1,075
Rep:
|
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.
|
|
|
09-26-2004, 11:17 AM
|
#4
|
Senior Member
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591
Rep:
|
Apache supports CGI and PHP by default,
thats not true. php has to be installed separately and added as a module to apache.
|
|
|
09-26-2004, 02:52 PM
|
#5
|
Senior Member
Registered: Mar 2004
Location: Wales, UK
Distribution: Debian, Ubuntu
Posts: 1,075
Rep:
|
Hmm. I don't remember having to do anything to set up PHP, although this was on RH Enterprise 3.0.
|
|
|
09-27-2004, 01:02 PM
|
#6
|
Senior Member
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591
Rep:
|
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
|
|
|
09-28-2004, 03:34 AM
|
#7
|
Senior Member
Registered: Mar 2004
Location: Wales, UK
Distribution: Debian, Ubuntu
Posts: 1,075
Rep:
|
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.
|
|
|
09-28-2004, 04:18 AM
|
#8
|
Member
Registered: Jul 2004
Location: Switzerland
Distribution: Debi@n, SuSE
Posts: 36
Rep:
|
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...
|
|
|
All times are GMT -5. The time now is 08:29 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|