Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Web Server How-To (Apache2 + mod_php + mysql)
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Fri Mar 11, 2005 10:46 am    Post subject: Reply with quote

Moved from Networking & Security.
Back to top
View user's profile Send private message
orvtech
Tux's lil' helper
Tux's lil' helper


Joined: 28 Aug 2004
Posts: 115
Location: US. Florida

PostPosted: Fri Mar 11, 2005 12:11 pm    Post subject: Reply with quote

Destroy? dude I allways install ~x86 and never had a problem, of course ... I've never install a web server usin ~x86, but i dont see why would I have a problem doing so. could you give me any example that had happened to you using ~x86 ?
_________________
http://orvtech.com
http://www.linuxevolution.org
Back to top
View user's profile Send private message
arghnoname
Tux's lil' helper
Tux's lil' helper


Joined: 13 Mar 2005
Posts: 84
Location: Washington, DC

PostPosted: Sat Mar 19, 2005 9:36 am    Post subject: Reply with quote

Quote:
echo "dev-php/php ~x86" >> /etc/portage/packages.keywords
echo "dev-php/php ~x86" >> /etc/portage/packages.keywords


Do you mean for that to say:

Quote:
echo "dev-php/php ~x86" >> /etc/portage/packages.keywords
echo "dev-php/mod_php ~x86" >> /etc/portage/packages.keywords


Anyway, I have to agree about global ~x86. Some people might get away with it, but it isn't anything I would recommend to a n00b like me.
Back to top
View user's profile Send private message
pwhitt
Tux's lil' helper
Tux's lil' helper


Joined: 25 Nov 2003
Posts: 85

PostPosted: Fri Mar 25, 2005 1:54 am    Post subject: Reply with quote

Quote:
Destroy? dude I allways install ~x86 and never had a problem, of course ... I've never install a web server usin ~x86, but i dont see why would I have a problem doing so. could you give me any example that had happened to you using ~x86 ?


well, i used to do that, but at some point i ran into problems with some package and stability - i don't remember what. when trying to downgrade it, portage barfed. apparently it was a sketchy file needed by other sketchy files, needed by other sketchy files, etc etc etc. my system was nothing but super sketchy packages. getting everything straight so i could fix it took days. now i use my /etc.../package.crap files - and i suggest everyone do the same. it takes a minute to do, requires at least a little thought and will discourage you from suddenly opening the floodgates of impending sketch. it's also a very easy way to track what you have done, and a great place to comment regarding your reasons for masking/unmasking a certain package. this way you can ensure that when you want to downgrade a package, you will have minimal complications.
Back to top
View user's profile Send private message
easy_coder
n00b
n00b


Joined: 24 Apr 2005
Posts: 23

PostPosted: Thu Apr 28, 2005 6:31 am    Post subject: Reply with quote

Can someone point me to an updated LAMP install guide for gentoo if this guide is out dated? I've looked around but nothing seams to recent..
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Sun Jun 26, 2005 4:51 pm    Post subject: Reply with quote

orvtech wrote:
Destroy? dude I allways install ~x86 and never had a problem, of course ... I've never install a web server usin ~x86, but i dont see why would I have a problem doing so. could you give me any example that had happened to you using ~x86 ?


That's the whole point, if you have a ~x86 installation you probably had that line anyway so the comment does not apply to you.

However , if you just arbitarily add that to make.conf on a system that is built as x86 you can expect some heavy shit to befall you.

That was dumb, ill-founded advice. Anyone posting something under the title of "HOWTO" should be responsible enought to make sure they post valid information.


@Kehl , please correct your original post to avoid ppls blowing out thier gentoos.

:roll:

Otherwise , thanks for some of the other info , it has saved ne a bit of digging.

[EDIT] moderators: any chance of changing that? I see kehl has 79 posts since march2003, I guess he's long gone

8)
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
mingotta
n00b
n00b


Joined: 11 Oct 2003
Posts: 52
Location: Roma, Italy

PostPosted: Sat Dec 17, 2005 6:01 pm    Post subject: Reply with quote

easy_coder wrote:
Can someone point me to an updated LAMP install guide for gentoo if this guide is out dated? I've looked around but nothing seams to recent..
I need it bad too!!

:oops:
Back to top
View user's profile Send private message
GoofballJM1
Guru
Guru


Joined: 22 Mar 2004
Posts: 392
Location: Denver, CO USA

PostPosted: Tue Dec 20, 2005 4:06 pm    Post subject: Reply with quote

Here it is:
http://gentoo-wiki.com/LAMP_Setup_Step_By_Step

Gentoo Wiki is loaded with howtos. The documentation isn't too different these days, unless you want to run PHP5. If you want to run PHP5 instead of PHP4 (which is what I do, it runs very stable now), Do this instead of installing mod_php:

Code:
#echo dev-lang/php dev-lang/php -X apache2 berkdb bzip2 calendar cli dba kerberos ldap mysql ncurses nls pcre mysqli pear session ssl wddx xml2 xmlrpc xsl >> /etc/portage/package.use


Perhaps that's too many use flags, this is my webserver for my company, so I have a lot of apps running on it. You at least need the apache2, mysql, and xml (wddx, xml, xmlrpc, xsl) use flags enabled. The apache2 use flag will create the apache module so you don't have to install a separate module after installing the php framework. It does it all in one shot

And then install PHP 5
Code:
emerge dev-lang/php


Edit your /etc/conf.d/apache2
Code:
APACHE2_OPTS="-D DEFAULT_VHOST -D PHP5"

Notice the PHP5 instead of the PHP4 on that line.
_________________
"Great spirits have often encountered violent opposition from weak minds." - Albert Einstein
Back to top
View user's profile Send private message
rdk
n00b
n00b


Joined: 31 Jul 2005
Posts: 27
Location: Zadar, Croatia

PostPosted: Thu Dec 22, 2005 5:51 pm    Post subject: Reply with quote

So here is the deal, i have written a complete HOW-TO-LAMP but there was a power outage and bye bye to all of my writings... :(

Let us start once more...
Setting up LAMP is not all that hard. Emerge it, configure it, start it and offfffffffffff you go... ( while we are going i am going to get some more beer... brb )
Burp... OK.


LAMP

What is LAMP? It is a acronym for LINUX, Apache, MySQL and PHP / Perl / Python
This is a popular dynamic web server / development environment based on OpenSource. :)


Emerge

I guess you already have Gentoo Linux installed, so we'll skip that and move over to Apache2, MySQL and PHP's.
First synchronize portage and install the necessary programs. To do this you need to run following commands.

Code:
# emerge sync
# emerge --pretend --verbose apache mysql dev-php/php mod_php

Take a good look in what USE flags are used by default and configure them to suit your needs.

Code:
# USE=" add/remove needed flags "  emerge --ask --verbose apache mysql dev-php mod_php

NOTE: You should really adjust USE settings in /etc/make.conf and run env-update so when you do an update same flags will be used for emergeing!

Sit back and relax, enjoy in tons of gcc output, get a bottle of beer and so on.... hmm... beeerrrr... brb...


Configuration

First we'll configure Apache2 web server. Gentoo used 2 config files earlier ( apache.conf & commonapache.conf ), but that has been removed in favor of using standard httpd.conf file.
Default Apache2 configuration resides in /etc/apache2 directory.

Open it up in your favorite text editor ( here we use vim ).

Code:
# cd /etc/apache2/; vim httpd.conf

You could change the following lines, although defaults work just fine:

Quote:
ServerAdmin root@localhost

E-mail address of server administrator

Quote:
ServerName localhost

This should be set to DNS name or IP address of your server. I use Dynamic DNS addressing for my server since i don't have a static IP address.

Quote:
UseCanonicalName Off

As i have said, I don't have a static IP address, so when someone wolud refer to my server by his current IP address and if my IP would change while he is connected to server he would, of course loose a connection. So i set UseCanonicalName to ON. This way when you refer to this server by his IP address, server would "redirect" the client to value set by ServerName directive ( which is my dynamic DNS name, so he would still stay connected after the IP has changed)

Also going throu configuration file you may have notice <IfDefine WHATEVER> </IfDefine> clauses. They are read by the Apache only if you start Apache with -D WHATEVER options thus defining the WHATEVER option. Now if you don't want run Apache manually all the time you can put those options in /etc/conf.d/apache2 file.

Code:
# cd /etc/conf.d; vim apache2

Find following line:

Quote:
APACHE2_OPTS="-D DEFAULT_VHOST"

And change it so Apache gets started with PHP module.

Quote:
APACHE2_OPTS="-D DEFAULT_VHOST -D USERDIR -D PHP4"

You may have notice that i have added USERDIR to Apache options. This enables serving files from a users home directory, or from elsewhere, depending on configuration setting which can also be found in /etc/apache2/httpd.conf.

Quote:
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
# enable by adding -D USERDIR to /etc/conf.d/apache2
#
<IfModule mod_userdir.c>
UserDir public_html
UserDir disabled root

#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>

Also you need to setup right permmisions on those directories. I think it should be 755 for Apache to be able to serve files, but don't quote me on this one.

More on topic:
Apache Documentation - Public Html
Apache Documentation - Sections
Apache Documentation - URL Mapping

If you want Apache to serve the files from another root location, then you want to change DocumentRoot directory. According to current APACHE2_OPTS which use -D DEFAULT_VHOST you should be changing 00_default_vhost.conf located in /etc/apache2/vhosts.d

Code:
cd /etc/apache2/vhosts.d/; vim 00_default_vhost.conf

This should be the default:

Quote:
DocumentRoot "/var/www/localhost/htdocs"

You can pretty much change it to point anywhere you want. I won't go deeper in VirtualHost configurations...

mod_php configuration can be found in /etc/apache2/modules.d/ in file 70_mod_php.conf

Next we are going to setup MySQL database. We have allready emerge it so now we only need to run MySQL install program and secure the installation.

Code:
# mysql_install_db
# mysql_secure_installation


That would just about wrap up a minimal configuration procedure.


Start up & testing

You can start apache by isueing following commands:

Code:
# /etc/init.d/apache2 start
# /etc/init.d/mysql start

If all goes well here and you have used same paths as I have, try the following:

Code:
# echo "<?php phpinfo(); ?>" /var/www/localhost/htdocs/test.php

Then with your favorite browser visit: http://127.0.0.1/test.php, of course if you are on the same machine as the web server.
You should then see the configuration settings of your PHP installation. If not something is wrong either in your Apache conf or in PHP / mod_php conf.


Other

You could setup PHPMyAdmin ( web interface for controlling MySQL databases; try emerge -s phpmyadmin ), perhaps SAMBA server so you can share the directories for web services on local network and ftp / sftp server to enable users and yourself to upload stuff to server over networks.
But i don't have anymore time, so i'll leave it for some other day.

More stuff on this:
http://httpd.apache.org/
http://www.mysql.com/
http://www.php.net/

WIKI STEP-BY-STEP LAMP

Apache2 configuration changes discussion

I really hope this helps, and please inform me if something is not correct in this post. THANKS.
I think I'll go buy me self a sandwich now...
_________________
Quote:
/* Would you like to try our SMCC Delux? */
/* Lettuce, tomato, buggy hardware (no extra charge)? */
/* Take care. */
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Mon Dec 26, 2005 6:58 pm    Post subject: Reply with quote

rdk wrote:
So here is the deal, i have written a complete HOW-TO-LAMP but there was a power outage and bye bye to all of my writings... :(


Sorry , couldnt help laughing when I read that, you're writing "how to lamp" and you get a power outage! Bet you wish you'd lit the lamp first :lol:
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
rdk
n00b
n00b


Joined: 31 Jul 2005
Posts: 27
Location: Zadar, Croatia

PostPosted: Tue Dec 27, 2005 1:16 am    Post subject: Reply with quote

Gentree wrote:
rdk wrote:
So here is the deal, i have written a complete HOW-TO-LAMP but there was a power outage and bye bye to all of my writings... :(


Sorry , couldnt help laughing when I read that, you're writing "how to lamp" and you get a power outage! Bet you wish you'd lit the lamp first :lol:


That's just my luck... :) :lol: ( oh yeah, and my bad english )...
_________________
Quote:
/* Would you like to try our SMCC Delux? */
/* Lettuce, tomato, buggy hardware (no extra charge)? */
/* Take care. */
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 Previous  1, 2, 3
Page 3 of 3

 
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