View previous topic :: View next topic |
Author |
Message |
elajoie n00b
Joined: 16 Jul 2003 Posts: 42 Location: Bellevue,WA,USA
|
Posted: Thu Jul 17, 2003 11:43 pm Post subject: Eric's Web Server How-To (For new installs & n00b's) |
|
|
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 )
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 |
|
|
elajoie n00b
Joined: 16 Jul 2003 Posts: 42 Location: Bellevue,WA,USA
|
Posted: Thu Jul 17, 2003 11:59 pm Post subject: Php test |
|
|
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 |
|
|
elajoie n00b
Joined: 16 Jul 2003 Posts: 42 Location: Bellevue,WA,USA
|
Posted: Fri Jul 18, 2003 5:50 am Post subject: Note |
|
|
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 |
|
|
slartibartfasz Veteran
Joined: 29 Oct 2002 Posts: 1462 Location: Vienna, Austria
|
Posted: Fri Jul 18, 2003 6:57 am Post subject: Re: Eric's Web Server How-To (For new installs & n00b's) |
|
|
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 |
|
|
elajoie n00b
Joined: 16 Jul 2003 Posts: 42 Location: Bellevue,WA,USA
|
Posted: Fri Jul 18, 2003 7:36 am Post subject: Update for n00b's |
|
|
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 |
|
|
joshdr77 Apprentice
Joined: 03 Jan 2003 Posts: 180
|
Posted: Sat Jul 19, 2003 5:30 am Post subject: |
|
|
thyanks for the howto worked great |
|
Back to top |
|
|
elajoie n00b
Joined: 16 Jul 2003 Posts: 42 Location: Bellevue,WA,USA
|
Posted: Sat Jul 19, 2003 8:32 pm Post subject: Setting Up the server and congiguration! |
|
|
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 |
|
|
BxBoy n00b
Joined: 04 Jul 2003 Posts: 32 Location: N.Y.C
|
Posted: Sat Jul 19, 2003 9:24 pm Post subject: |
|
|
looking good |
|
Back to top |
|
|
ClippyHater Apprentice
Joined: 06 Nov 2002 Posts: 247 Location: Wisconsin
|
Posted: Sun Jul 20, 2003 12:21 am Post subject: |
|
|
Does this result in PHP being run as a SAPI module or CGI? I'm not sure how to find out
Thanks!
Oh, BTW, your line:
should probably be:
Code: | /etc/conf.d/apache2 |
|
|
Back to top |
|
|
elajoie n00b
Joined: 16 Jul 2003 Posts: 42 Location: Bellevue,WA,USA
|
Posted: Sun Jul 20, 2003 5:18 am Post subject: Re-Edit and reply |
|
|
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 |
|
|
epretorious Apprentice
Joined: 04 Jul 2003 Posts: 191 Location: Truckee, CA
|
Posted: Sun Jul 20, 2003 9:43 am Post subject: How can I get mod_php to work with Apache? |
|
|
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? _________________ Eric P.
Sunnyvale, CA |
|
Back to top |
|
|
elajoie n00b
Joined: 16 Jul 2003 Posts: 42 Location: Bellevue,WA,USA
|
Posted: Mon Jul 21, 2003 3:28 am Post subject: Mod_PHP |
|
|
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 |
|
|
epretorious Apprentice
Joined: 04 Jul 2003 Posts: 191 Location: Truckee, CA
|
Posted: Mon Jul 21, 2003 3:22 pm Post subject: Re: Mod_PHP |
|
|
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? _________________ Eric P.
Sunnyvale, CA |
|
Back to top |
|
|
elajoie n00b
Joined: 16 Jul 2003 Posts: 42 Location: Bellevue,WA,USA
|
Posted: Thu Jul 24, 2003 11:48 pm Post subject: PHP |
|
|
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 |
|
|
elajoie n00b
Joined: 16 Jul 2003 Posts: 42 Location: Bellevue,WA,USA
|
Posted: Thu Jul 24, 2003 11:51 pm Post subject: Security |
|
|
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 |
|
|
elajoie n00b
Joined: 16 Jul 2003 Posts: 42 Location: Bellevue,WA,USA
|
Posted: Wed Aug 06, 2003 10:39 am Post subject: Germany |
|
|
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 |
|
|
maalth Tux's lil' helper
Joined: 06 Jun 2003 Posts: 76 Location: Can't tell you...
|
Posted: Fri Aug 08, 2003 9:54 pm Post subject: Correction |
|
|
Eric,
The line: APACHE_OPTS="-D SSL -D PHP4"
Should instead read: APACHE_OPTS="-D SSL -D PHP"
|
|
Back to top |
|
|
ClippyHater Apprentice
Joined: 06 Nov 2002 Posts: 247 Location: Wisconsin
|
Posted: Sun Aug 10, 2003 12:03 am Post subject: |
|
|
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 |
|
|
maalth Tux's lil' helper
Joined: 06 Jun 2003 Posts: 76 Location: Can't tell you...
|
Posted: Sun Aug 10, 2003 12:14 am Post subject: |
|
|
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 |
|
|
wHAcKer Apprentice
Joined: 18 Oct 2002 Posts: 228 Location: Grimbergen, Belgium
|
Posted: Sun Aug 10, 2003 11:38 pm Post subject: |
|
|
it DOES work for me |
|
Back to top |
|
|
elajoie n00b
Joined: 16 Jul 2003 Posts: 42 Location: Bellevue,WA,USA
|
Posted: Mon Aug 11, 2003 6:16 am Post subject: PHP4 |
|
|
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 |
|
|
mog Apprentice
Joined: 05 Jul 2003 Posts: 253 Location: Auckland [NZ]
|
Posted: Sun Aug 24, 2003 10:09 am Post subject: |
|
|
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 |
|
|
plate Bodhisattva
Joined: 25 Jul 2002 Posts: 1663 Location: Berlin
|
Posted: Sun Aug 24, 2003 12:05 pm Post subject: |
|
|
Very helpful, thanks!
Moved from Networking & Security. |
|
Back to top |
|
|
epretorious Apprentice
Joined: 04 Jul 2003 Posts: 191 Location: Truckee, CA
|
Posted: Mon Aug 25, 2003 2:50 am Post subject: |
|
|
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 |
|
|
bd Apprentice
Joined: 12 Mar 2003 Posts: 172 Location: Onsala, SWEDEN
|
Posted: Sun Aug 31, 2003 8:23 pm Post subject: |
|
|
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 |
|
|
|