Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting up a very simple LAMP test server
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ElleStone
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2013
Posts: 91

PostPosted: Sat May 11, 2013 4:30 pm    Post subject: Setting up a very simple LAMP test server Reply with quote

Hello All,

I would like to set up a very simple Gentoo lamp test server. I already have Gentoo itself up and running (64-bit no-multilibs). I've set up test servers under Ubuntu, Debian, and openSUSE, but never under Gentoo.

I'll probably have other questions, but my first question is about modules. Possibly relevant information:

*By "test server" I mean Apache should only listen to localhost and only on port 80. For example, on an Ubuntu test server that I recently set up, this is the "netstat -anp" line for Apache:
Code:
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:80            0.0.0.0:*               LISTEN      1048/apache2

*The test server's main purpose is for working on articles prior to posting them to my live website (the live website is hosted commercially).
*I don't use ssl.
*I don't use cgi or SSI.
*I don't use ftp-related stuff.
*I don't use vhosts (there is just one website).
*I don't need spelling mistakes corrected (speling module should not be included?).
*I do use PHP to serve up the "in common" portions of my website.
*I'm experimenting with Wordpress, so I do need the rewrite module.
*I've already installed mariadb rather than mysql.

Any advice regarding modifying/pruning down the Apache modules list is greatly appreciated. Looking at the output from "emerge --info", there are 50 different APACHE2_MODULES. http://en.gentoo-wiki.com/wiki/Apache2/APACHE2_MODULES (actually the google cache thereof) gives one-line explanations for the Apache modules, but alas to this newbie, at first glance the explanations might as well have been written in Klingon. And at second glance, hardly any of them seem appropriate for a very simple test server.

Elle
Back to top
View user's profile Send private message
ElleStone
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2013
Posts: 91

PostPosted: Mon May 13, 2013 6:06 pm    Post subject: Reply with quote

Based on further investigation, apache2_modules to use for a basic test lamp server:

http://httpd.apache.org/docs/2.2/mod/index.html
http://httpd.apache.org/docs/2.2/misc/perf-tuning.html

Probably use these modules (these apache USE flags are all enabled by default, along with a bunch of other USE flags that I disabled in package.use):
alias
authz_host
dir
info (?)
log_config
mime
negotiation (?)
rewrite

All the other default apache USE flags probably can be disabled.

To get the php-apache module, add "apache2" to the php USE flags and install php.

Apparently one shouldn't use threads with php:
http://serverfault.com/questions/231628/apache-mpms-worker-vs-prefork

So the appropriate additional apache USE flags hopefully are:
"mpms_prefork" USE flag: use
"threads" USE flag: don't use
"mpms_worker" USE flag: don't use

I installed apache and php configured as above, and going to localhost with Firefox reveals "It works!"

Now for some questions:

1. Here is what I put in make.conf:
Code:
APACHE2_MODULES="authn_core authz_core socache_shmcb unixd alias auth_host dir info log_config mime negotiation rewrite"

These default "emerge --info" entries - authn_core authz_core socache_shmcb unixd - don't correspond to any of the apache USE flags. What do they do? Should they be in listed in APACHE2_MODULES in make.conf? Do the USE flags need to be set twice, one in package.use and once again in make.conf?

2. How does one list which modules Gentoo's Apache2 is actually using? "apachectl -t -D DUMP_MODULES" doesn't work.

3. Why are there 5 VHOST subprocesses listed in htop? I did compile apache without the vhost USE flag.

4. Just to avoid any potential issues, although Apache2 and php both compiled with link time optimization, I recompiled both without lto. Has anyone used apache/php compiled with lto? (I compiled both with graphite and openmp enabled in the cflags and ldflags).

Finding on-line documentation for setting up a test server is easy, but of course none of them talk about modules in any depth and none of them are specific to Gentoo (leastways I didn't find any). I've read through several Gentoo pages on Apache, and I'm working my way through the Slicehost Gentoo Apache pages (http://articles.slicehost.com/2009/8/14/gentoo-installing-apache). Input, suggestions, advice on what I've done so far to set up my Gentoo test LAMP server would be very welcome.

Elle
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
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