Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Eric's Web Server How-To (For new installs & n00b's)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
elajoie
n00b
n00b


Joined: 16 Jul 2003
Posts: 42
Location: Bellevue,WA,USA

PostPosted: Thu Jul 17, 2003 11:43 pm    Post subject: Eric's Web Server How-To (For new installs & n00b's) Reply with quote

So, over the past few days I have toyed with a few gentoo installs to get my web server running the way I want it too. Below I will list the step I did to get it working. (I HOPE IT HELPS :twisted: )

NOTE:
1. Every time you edit your /etc/make.conf file type env-update (return) to make your changes take effect!
2. Code is in DARK BLUE
3. File listings are in RED
4. Do a ("-p" for pretend) on each emerge to see what your emerging eg.(emerge -p foobar)

FIRST:
I installed gentoo from stage 1 with these /etc/make.conf file settings and gentoo-sources kernel:
USE="-X -gtk -gnome -qt -kde -alsa -qtmt -pdflib -apache -truetype mysql apache2 pam ssl xml xml2"

Second:
To set the starting point do a sync and update:
emerge sync
emerge -uD world
The D stand for deep (Ill Update when I find the meaning of D is exactly)
Now emerge mysql (If you want!):
emerge mysql
ebuild /var/db/pkg/dev-db/mysql.foo*/mysql.foo*.ebuild config
Important! Replace "foo" in the directly above code to match your installed package by pressing TAB when you have already typed "mysql" which will auto compleate.
rc-update add mysql default

This I got from khel on his post:
emerge netpbm

Now we emerge apache2:
emerge apache
rc-update add apache2 default

Now we emerge PHP:
emerge php

And also the php module:
emerge mod_php
emerge clean
(this gets rid of any extra php modules i think, acording to khel's post)
ebuild /var/db/pkg/dev-php/mod_php-foo*/mod_php-foo*.ebuild config
Again, replace foo with the autocompleated package version

Now edit your /etc/conf.d/apache2 to enable php support:
nano -w /etc/conf.d/apache2
Edit the line APACHE_OPTS to look like this
APACHE_OPTS="-D SSL -D PHP4"

Start you deamons!!:
/etc/init.d/mysql start
/etc/init.d/apache start

Test you page:
BEFORE you try this:
emerge lynx
lynx (your IP or localhost name or 127.0.0.1)

One final thing that stumped me was that SSL comes bundled with apache2 you dont have to emerge it and also if you want phpBB there is no stable ebuild for it to go in combo with apache2. Look at the ebuild howto on the gentoo site for info to check the bug.gontoo.org listing.


Last edited by elajoie on Tue Apr 13, 2004 10:26 pm; edited 9 times in total
Back to top
View user's profile Send private message
elajoie
n00b
n00b


Joined: 16 Jul 2003
Posts: 42
Location: Bellevue,WA,USA

PostPosted: Thu Jul 17, 2003 11:59 pm    Post subject: Php test Reply with quote

If you want to make a PHP test page do the fallowing after the sevrer is up and running:
echo "<? phpinfo() ?>" > /var/www/localhost/htdocs/test.php

Then:
lynx http://localhost/test.php

(note, I think you can put in 127.0.0.1 for your loopback port if our on the server when you try to connect)


Last edited by elajoie on Sun Sep 10, 2006 11:14 pm; edited 2 times in total
Back to top
View user's profile Send private message
elajoie
n00b
n00b


Joined: 16 Jul 2003
Posts: 42
Location: Bellevue,WA,USA

PostPosted: Fri Jul 18, 2003 5:50 am    Post subject: Note Reply with quote

And if anyone see's important stuff to be added please respond, I would be glad to make an upgrade post for people upgading even though Apache2 dosnt support everything....

Last edited by elajoie on Fri Jul 18, 2003 7:37 am; edited 1 time in total
Back to top
View user's profile Send private message
slartibartfasz
Veteran
Veteran


Joined: 29 Oct 2002
Posts: 1462
Location: Vienna, Austria

PostPosted: Fri Jul 18, 2003 6:57 am    Post subject: Re: Eric's Web Server How-To (For new installs & n00b's) Reply with quote

elajoie wrote:
and I used the normal settings through out the file along with this:
ACCEPT_KEYWORDS="~x86"
(notice this is for my pentium computer.. change to correct arch. if you have other)


why? if this should be for noobs then u should at least mention that this will emerge unstable packages ;)

Quote:
1. so its back at the top of the stack!


doesnt make a good reason in general....
_________________
To an engineer the glass is neither half full, nor half empty - it is just twice as big as it needs to be.
Back to top
View user's profile Send private message
elajoie
n00b
n00b


Joined: 16 Jul 2003
Posts: 42
Location: Bellevue,WA,USA

PostPosted: Fri Jul 18, 2003 7:36 am    Post subject: Update for n00b's Reply with quote

As you look in the /etc/make.conf file you will see a discription for the entry ACCEPT_KEYWORDS="~arch". Edit this only if you get problems emergeing Apache2. I know I needed it to emerge apache2 but it seems the ebuilds and releases are now officialy released.

Thanks slartibartfasz for the update.. =)
Back to top
View user's profile Send private message
joshdr77
Apprentice
Apprentice


Joined: 03 Jan 2003
Posts: 180

PostPosted: Sat Jul 19, 2003 5:30 am    Post subject: Reply with quote

thyanks for the howto :) worked great :)
Back to top
View user's profile Send private message
elajoie
n00b
n00b


Joined: 16 Jul 2003
Posts: 42
Location: Bellevue,WA,USA

PostPosted: Sat Jul 19, 2003 8:32 pm    Post subject: Setting Up the server and congiguration! Reply with quote

I will be posting my configuration soon and also I will try to get this put into the document forum once its complete.

-elajoie =)
Back to top
View user's profile Send private message
BxBoy
n00b
n00b


Joined: 04 Jul 2003
Posts: 32
Location: N.Y.C

PostPosted: Sat Jul 19, 2003 9:24 pm    Post subject: Reply with quote

looking good
Back to top
View user's profile Send private message
ClippyHater
Apprentice
Apprentice


Joined: 06 Nov 2002
Posts: 247
Location: Wisconsin

PostPosted: Sun Jul 20, 2003 12:21 am    Post subject: Reply with quote

Does this result in PHP being run as a SAPI module or CGI? I'm not sure how to find out :oops:

Thanks!

Oh, BTW, your line:

Code:
/etc/conf.d/apache

should probably be:
Code:
/etc/conf.d/apache2
Back to top
View user's profile Send private message
elajoie
n00b
n00b


Joined: 16 Jul 2003
Posts: 42
Location: Bellevue,WA,USA

PostPosted: Sun Jul 20, 2003 5:18 am    Post subject: Re-Edit and reply Reply with quote

Hi,

In one of the most recent PHP releases you could gain access to a server my using CGI to get user privledges in PHP. I hope this is what you were refering to ClippyHater? Check out the link!!! HERE!!!

Thanks for the apache code edit.. I checked and you are right ClippyHater Thanks!

Keep the info comming, This will help in makeing the HOWTO a better source and help....

-elajoie
Back to top
View user's profile Send private message
epretorious
Apprentice
Apprentice


Joined: 04 Jul 2003
Posts: 191
Location: Truckee, CA

PostPosted: Sun Jul 20, 2003 9:43 am    Post subject: How can I get mod_php to work with Apache? Reply with quote

Hello, Elajoie:

I've just finished merging Apache 1.3.27-r4 and mod_php 4.3.2-r3. Apache works fine except for parsing PHP files.

I've added the directives...
Code:
Loadmodule php4_module extramodules/libphp4.so
Addmodule mod_php4.c

...to /etc/apache/conf/apache.conf and the contents of /etc/apache/conf/addon-modules/mod_php.conf...
Code:
<IfModule mod_php4.c>
AddType applications/x-httpd-php   .php .php4 .php3 .phtml
AddType applications/x-httpd-php-source .phps
</IfModule>

...to /etc/apache/conf/commonapache.conf.

Before I added the Loadmodule and Addmodule directives, Apache functioned correctly.
Now that I've added these directives, Apache starts without any complaints but won't bind to any ports and won't respond to any requests.

What's wrong? :evil:
_________________
Eric P.
Sunnyvale, CA
Back to top
View user's profile Send private message
elajoie
n00b
n00b


Joined: 16 Jul 2003
Posts: 42
Location: Bellevue,WA,USA

PostPosted: Mon Jul 21, 2003 3:28 am    Post subject: Mod_PHP Reply with quote

I looked around for your problem and it seems to have a few people stumped... Can you please tell me what PHP install you did also... ?

-elajoie
Back to top
View user's profile Send private message
epretorious
Apprentice
Apprentice


Joined: 04 Jul 2003
Posts: 191
Location: Truckee, CA

PostPosted: Mon Jul 21, 2003 3:22 pm    Post subject: Re: Mod_PHP Reply with quote

elajoie wrote:
Can you please tell me what PHP install you did also?


I did not merge php - only mod_php. There wasn't a dependancy so I didn't merge it. Is it required? 8O
_________________
Eric P.
Sunnyvale, CA
Back to top
View user's profile Send private message
elajoie
n00b
n00b


Joined: 16 Jul 2003
Posts: 42
Location: Bellevue,WA,USA

PostPosted: Thu Jul 24, 2003 11:48 pm    Post subject: PHP Reply with quote

Well.... To tell you the truth Im not sure.

I asked around at my office and no one knew the answer.. I looked around the web for info and I did see alot of trubble with apache 1 and php4... ill keep looking....

-elajoie
Back to top
View user's profile Send private message
elajoie
n00b
n00b


Joined: 16 Jul 2003
Posts: 42
Location: Bellevue,WA,USA

PostPosted: Thu Jul 24, 2003 11:51 pm    Post subject: Security Reply with quote

Well it looks like im going to update this post with security info...

I fallowed the gentoo HOWTO on security and alot of it is outdated including alot of the config entries. Im going to try and make edits directly to the original and port it to gentoo and also to this forum..

Beware of the kernel configs also and the disk quota stuff...

-elajoie
Back to top
View user's profile Send private message
elajoie
n00b
n00b


Joined: 16 Jul 2003
Posts: 42
Location: Bellevue,WA,USA

PostPosted: Wed Aug 06, 2003 10:39 am    Post subject: Germany Reply with quote

Well I am in Germany for the month of August and during the 24th through the 1st of September I will be in Croasia. If anyone from the Munich area or northern Croatia wants to meet up drop me an email.

-elajoie

ps. its a little off from my normal topic but I will deleate the post when I get back to the states.
Back to top
View user's profile Send private message
maalth
n00b
n00b


Joined: 06 Jun 2003
Posts: 56
Location: Can't tell you...

PostPosted: Fri Aug 08, 2003 9:54 pm    Post subject: Correction Reply with quote

Eric,

The line: APACHE_OPTS="-D SSL -D PHP4"

Should instead read: APACHE_OPTS="-D SSL -D PHP"
Back to top
View user's profile Send private message
ClippyHater
Apprentice
Apprentice


Joined: 06 Nov 2002
Posts: 247
Location: Wisconsin

PostPosted: Sun Aug 10, 2003 12:03 am    Post subject: Reply with quote

maalth, I think it needs to be PHP4, not PHP--a note in /etc/conf.d/apache2 explicity said that this is a change in order to make eventual upgrades to PHP version 5 automatic.
Back to top
View user's profile Send private message
maalth
n00b
n00b


Joined: 06 Jun 2003
Posts: 56
Location: Can't tell you...

PostPosted: Sun Aug 10, 2003 12:14 am    Post subject: Reply with quote

Actually -D PHP4 does not work. I've tried it and as you can see by some of the other posts, it didn't work for them either.
Back to top
View user's profile Send private message
wHAcKer
Apprentice
Apprentice


Joined: 18 Oct 2002
Posts: 228
Location: Grimbergen, Belgium

PostPosted: Sun Aug 10, 2003 11:38 pm    Post subject: Reply with quote

it DOES work for me :)
Back to top
View user's profile Send private message
elajoie
n00b
n00b


Joined: 16 Jul 2003
Posts: 42
Location: Bellevue,WA,USA

PostPosted: Mon Aug 11, 2003 6:16 am    Post subject: PHP4 Reply with quote

Hi All,

I used the PHP4 option on my server and my php test page worked just fine. I found tons of links for php4 being listed on gentoo's docs.

-elajoie
Back to top
View user's profile Send private message
mog
Apprentice
Apprentice


Joined: 05 Jul 2003
Posts: 253
Location: Auckland [NZ]

PostPosted: Sun Aug 24, 2003 10:09 am    Post subject: Reply with quote

good post ... unfortunately there are few good howto posts regarding apache that really cover the lot ... well I followed your post exactly, but I am getting the following error on start-up:

Code:
Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName


then apache2 exits ... I noticed that because trying to stop it tells me that it is not running yet ...

any ideas?
_________________
To thine own self be true.
Back to top
View user's profile Send private message
plate
Bodhisattva
Bodhisattva


Joined: 25 Jul 2002
Posts: 1663
Location: Berlin

PostPosted: Sun Aug 24, 2003 12:05 pm    Post subject: Reply with quote

Very helpful, thanks! 8)

Moved from Networking & Security.
Back to top
View user's profile Send private message
epretorious
Apprentice
Apprentice


Joined: 04 Jul 2003
Posts: 191
Location: Truckee, CA

PostPosted: Mon Aug 25, 2003 2:50 am    Post subject: Reply with quote

mog wrote:
Code:
Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName


During start-up, Apache uses the resolver to verify that the name that it's given (using the ServerName directive in /etc/apache/conf/apache.conf) actually corresponds to the name returned by the resolver for the interface that Apache is configured to monitor (using the BindAddress or Listen directives in /etc/apache/conf/apache.conf).

In /etc/apache/conf/apache.conf, set the ServerName to ...
    The name of the machine as it exists in your name server (if your running BIND) or your ISP's name server (i.e., The internet name of the machine), or
    The name of the machine as it exists in /etc/hosts (e.g., localhost).
The resolver checks both locations. See man resolv.conf for more information
_________________
Eric P.
Sunnyvale, CA
Back to top
View user's profile Send private message
bd
Apprentice
Apprentice


Joined: 12 Mar 2003
Posts: 172
Location: Onsala, SWEDEN

PostPosted: Sun Aug 31, 2003 8:23 pm    Post subject: Reply with quote

Hi!

PHP doesnt work for me. Maybe because of this:
Code:
FireBird / # ebuild /var/db/pkg/dev-php/mod_php-4.3.2-r4/mod_php-4.3.2-r4.ebuild config
 * Due to some previous bloopers with PHP and slotting, you may have
 * multiple copies of mod_php installed. Please look at the autoclean
 * output at the end of the emerge and unmerge all but relevant
 * copies.
 * Edit /etc/conf.d/apache2 and add "-D PHP4"
 * This is a CHANGE from previous behavior, which was "-D PHP"
 * This is for the upcoming PHP5 support. The ebuild will attempt
 * to make this update between PHP and PHP4 automatically
I don't know what to do... Do you?

Thanks in advance...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum