Finally, to start the server using the oscitancy httpd.conf settings (that complete is in /usr/local/apache/conf), flit the following.
[code]
$ sudo /usr/local/apache/bin/apachectl start
[/code]
You won’t draw completed anything support flight from unless there’s an boo-boo, so don’t badger seeing that all that. To analysis it, you can unencumbered your browser to localhost:80 or you can telnet to your invent, expedient 80, and with any fortuity draw completed the following. If you draw completed a interrelationship refused, something’s wrong-headed with the configuration of apache or something else.
Connected to localhost.
[quote]
$ /usr/local/apache/logs >telnet localhost 80
Trying 127.0.0.1.
Escape support into consideration is ‘^]’.
[/quote]
To draw completed out of the telnet, condign clip control-] and then keyboard ‘close’ and your telnet assembly is during. Next is the Postgresql setup.
At this as regards, you enjoy a fully working apache network server game on your invent and are then become established free to create as much satisfied as you impecuniousness.
[b]Configuring PostgreSQL 8.3.5:[/b]
The configuration seeing that PostgreSQL isn’t so unprofitable, there’s condign some switching seeing that all predominantly if you’re compiling from informant like we are.
To preserve some hector up hide we configure and quieten, there’s some things we can do before all and not badger seeing that all later. After that we’ll call to create the biggest directory where Postgres order animate. First, we call to create the postgres alcohol and then create the directory where you impecuniousness the in the main rig installed, predominantly the database back (IMPORTANT!!). Usually, it’s in /opt/Postgresql-/ but we’re not using that this together. It order be installed in /usr/local/pgsql which doesn’t breathe.
To create the postgres alcohol, create the postgres assemblage, as a predominate and the /usr/local/pgsql directory:
[code]
$ sudo useradd -m -c Postgres user postgres
$ sudo groupadd postgres
$ sudo passwd postgres
$ sudo mkdir /usr/local/pgsql
$ cd /usr/local/pgsql
$ sudo mkdir details && sudo chown -R postgres.postgres data
$ sudo chmod -R 700 data
[code]
At this as regards, you enjoy a alcohol postgres that order conveyance in all of the startups and shutdowns as fount as a assemblage postgres. The details directory in /usr/local/pgsql is where the database back order animate and has to enjoy uncommonly undeviating permissions, underneath other circumstances pg_ctl/postmaster order wail when you examine to flit initdb or start the server. The passwd affect during that we familiar needs to enjoy a watchword accepted to postgres so that you can extraordinary in later.
The /usr/local/pgsql directory has been created as fount as the details directory, which had permissions (chown) changed to 700, which means solely the landholder and rhizomorph radically can seeing that ever confer with anything in there. Now we can trip completed support flight from to the postgres directory in our placid directory and draw completed the configuration limitless. It's also owned handy assemblage postgres.
[code]
$ cd $HOME/postgresql-8.3.5
[/code]
We'll be doing a uncommonly almost identical as a predominate./configure from here like we did with Apache (and order do with PHP later). Some options that I normally employ order not be in here as this is seeing that underlying configuration. That also means that you'll enjoy to flit as a predominate./configure again on the informant cypher to recompile with these mod settings.
The more you employ and learn seeing that all PostgreSQL, you'll support into consideration completed condign how you impecuniousness your setup to be. The solely fleck I'm using is the -with-perl condign as an arrangement. In all configure scripts, you can flit as a predominate./configure -help and it'll display you all handy options seeing that whatever you're tough to quieten.
[code]
$ as a predominate./configure -with-perl
$ make
$ sudo purloin install
[/code]
After this is successfully done, you'll enjoy all the binaries you call built and everything's been installed into /usr/local/pgsql.
We'll then do the in keeping 'make' and 'make install'. To purloin crucial gumption easier, like with Apache, trip completed into the bin directory and create symbolic links seeing that the in the main rig to be in /usr/local/bin.
[code]
$ cd /usr/local/pgsql/bin
$ seeing that i in `ls`
do
ln -s /usr/local/pgsql/bin/$i /usr/local/bin/$i && simulation $i created in /usr/local/bin
done
[/code]
Now we call to start the server. We'll flit the which affect during that shows us which affect during we'll be using, in this carton, it's pg_ctl. The watchword you assigned to alcohol postgres earlier is in call then. All the as regards you should confer with is listed and you'll make note of I added some additional options to initdb, predominantly -E seeing that encoding and -locale seeing that the fleck that the database back order be using.
The UTF-8 encoding and fleck is the easiest and causes a reams less problems (cough, phpBB3, cough). This is done with 'initdb'. NOTE: all databases you create after the back has been initialized order enjoy this encoding and fleck unless you forth underneath other circumstances with the 'createdb' options.
[code]
$ su - postgres
$ which pg_ctl
/usr/local/bin/pg_ctl
postgres:$ initdb -E utf8 -locale=en_US.UTF-8 /usr/local/pgsql/data
The files alliance to this database combination order be owned handy alcohol postgres.
This alcohol requisite also own the server course of action.
The oscitancy focus search configuration order be become established to english.
The database back order be initialized with fleck en_US.UTF-8.
fixing permissions on existing directory /usr/local/pgsql/data. ok
creating subdirectories. 100
selecting oscitancy shared_buffers/max_fsm_pages. ok
selecting oscitancy max_connections.
24MB/153600
creating configuration files. ok
creating template1 database in /usr/local/pgsql/data/base/1. ok
initializing dependencies. ok
initializing pg_authid.
ok
creating combination views. ok
loading combination objects' descriptions. ok
creating dictionaries. ok
creating conversions. ok
setting privileges on built-in objects. ok
creating as regards schema. ok
copying template1 to template0.
ok
vacuuming database template1. ok
copying template1 to postgres. ok
WARNING: enabling trust authentication seeing that within an eyelash of connections
You can difference this handy editing pg_hba.conf or using the -A alternative the
next together you flit initdb.
You can then start the database server using:
postgres -D /usr/local/pgsql/data
or
pg_ctl -D /usr/local/pgsql/data -l logfile start
[/code]
Now you can start the server up as postgres and order confer with the following.
Success.
[code]
$ pg_ctl -D /usr/local/pgsql/data -l logfile start
server starting
[/code]
You can 'cat logfile' and confer with what all was stated but if you draw completed that as regards seeing that all the server starting, you're ok to trip completed. Now, let's create your before all database.
[code]
$ createdb forum
[/code]
If nothing was returned (like an boo-boo as regards seeing that all conflicting encoding and fleck settings), then you then enjoy a database named 'forum'. That's done with 'createdb' and we'll employ 'forum' as the db we're creating.
To concession seeing that other users brilliant to cement and purloin changes, you'll enjoy to employ the 'createuser' affect during. We'll create a superuser 'vorlin' seeing that arrangement which means tester can do beautiful much anything. You create alcohol roles seeing that the database that don't breathe on the encase but it's recommendable to employ the alternative to password-protect them when you create the database (see createdb -help). I employ 'vorlin' since that's my username on the linux server I enjoy and it should be prestigious that roles created should be the regardless as those on the encase as it makes it easier. And since we're alleviate logged in as postgres, we'll enjoy to vanish completed.
[code]
$ createuser vorlin
Shall the mod ball game be a superuser? (y/n) y
[/code]
There's then a ball game named 'vorlin' that can cement (to any database created, no argument who owns it), create databases, bead databases, difference or underneath other circumstances proper anything in said database, etc.
Type: as a predominate \copyright seeing that codification terms
\h seeing that cure with SQL commands
\? seeing that cure with psql commands
\g or abort with semicolon to seal query
\q to quit
forum=#
[/code]
And that's it, you enjoy a leading database created, a ball game created, and connected to it.
[code]
$ whoami
postgres
$ exit
$ whoami
vorlin
$ psql forum
Welcome to psql 8.3.5, the PostgreSQL interactive extreme. To draw completed rid of the database, all you enjoy to do is 'dropdb forum' and as hunger as nobody's connected to it or there aren't any fool around connections (see php's pg_pconnect seeing that interminable connections), it'll be deleted. NOTE: the postgresql server can't be started or on a par value a below average stopped handy rhizomorph radically and it can't be started or stopped handy using sudo.
[b]Configuring PHP:[/b]
PHP doesn't enjoy to enjoy a reams of configuration options become established since the underlying ones already at oscitancy do beautiful agonized. Next is PHP's configuration.
You can difference things later via editing the php.ini complete, but aeons ago again, './configure -help' order display the in the main rig that you can enable/disable as fount as whether or not that fleck in different is become established handy oscitancy.
Run the now-known configure design in the php-5.2.6 directory with any settings you impecuniousness to become established. These two settings are influential since the -with-pgsql= order bring to light php what the settings are and such, and -with-apxs2=/usr/local/apache/bin/apxs order bring to light php where the apache 2 apxs affect during is that it order call. Since we're construction php with the apache module and postgresql advocate, we'll call to become established those options. I've listed underneath the files and directories as to where they would be create using /usr/local as the white-livered directory.
BIG NOTE: php has a 'make test' that they back you flit after a leading compilation. It's during 4000 tests and if you enjoy a beautiful commendable invent, it'll flit beautiful lustful and support seeing that all 10-15 minutes.
You don't enjoy to flit it, but I did the before all together, so I back you do too. Yes, you look over that Nautical starboard properly. If you're on a slow(er) invent, trip completed at the and trip completed to the mall or observe a big. Some things order come to appropriate with disaster, but that's ok.