- scompattare il tar.gz binario. Ad. es. dalla directory da cui
lo si è scaricato dare il comando:
# tar zxvf mysql-max-3.23.49-unknown-freebsdelf4.4-i386.tar.gz -C /usr/local/
- per comodità si crea un link simbolico alla directory
che contiene tutta la distribuzione:
# cd /usr/local
# ln -s mysql-max-3.23.49-unknown-freebsdelf4.4-i386 mysql
# cd mysql
- a questo punto si seguono le istruzioni in:
# less INSTALL-BINARY
- occorre creare un utente mysql appartenente al gruppo
principale mysql (volendo si può scegliere anche un altro
nome). Sotto FreeBSD questo si fa con pw(8), ad es. con le seguenti
opzioni:
# pw user add -n mysql -c "MySQL User" -d /usr/local/mysql
- occorre poi creare un database che si chiama `mysql', che
contiene tutte le informazioni sui privilegi di accesso al server:
# ./scripts/mysql_install_db
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
020430 18:48:29 ./bin/mysqld: Shutdown Complete
To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
./bin/mysqladmin -u root -p password 'new-password'
./bin/mysqladmin -u root -h ninux.rett.polimi.it -p password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; ./bin/safe_mysqld &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; run-all-tests
Please report any problems with the ./bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
- quindi aggiustare i permessi:
# chown -LR root /usr/local/mysql
# chown -LR mysql /usr/local/mysql/data
# chgrp -LR mysql /usr/local/mysql
- si prova poi l'avvio manuale del server:
# /usr/local/mysql/bin/safe_mysqld --user=mysql &
- si prova a connettersi al server e, per es., visualizzare
l'elenco dei database presenti:
# /usr/local/mysql/bin/mysqlshow
+-----------+
| Databases |
+-----------+
| mysql |
| test |
+-----------+
- per predisporre l'avvio automatico al boot, creare in
/usr/local/etc/rc.d uno script che si chiama ad es. mysql-server.sh
col seguente contenuto ed assegnargli il permesso di esecuzione:
#!/bin/sh
cd /usr/local/mysql/
case "$1" in
start)
if [ -x bin/safe_mysqld ]; then
./bin/safe_mysqld --user=mysql > /dev/null & && echo -n ' mysqld'
fi
;;
stop)
/usr/bin/killall mysqld > /dev/null 2>&1 && echo -n ' mysqld'
;;
*)
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
exit 64
;;
esac
- la connessione come utente root per default è abilitata
solo da localhost. Nonostante ciò per maggiore sicurezza,
impostiamo una password per l'account root di mysql:
# ./bin/mysqladmin -u root password 'nuova_password'
# ./bin/mysqladmin -u root -h ninux.rett.polimi.it password 'nuova_password'
qui sostituite nuova_password con la password scelta e
ninux.rett.polimi.it con il vostro nome host.
- se tutte le richieste al database server verranno fatte dall'host locale
tramite socket di Unix, allora si può dire a mysqld di non aprire proprio
connessioni TCP/IP, aggiungendo un'opzione alla riga che chiama safe_mysqld
in /usr/local/etc/rc.d/mysql-server.sh:
./bin/safe_mysqld --skip-networking --user=mysql > /dev/null & && echo -n ' mysqld'
- se non esiste creare una directory per contenere i sorgenti
# mkdir /usr/local/src/
# chmod 700 /usr/local/src/
- scompattare l'archivio. Dalla directory da cui lo si è
scaricato:
# tar zxvf apache_1.3.24.tar.gz -C /usr/local/src/
# cd /usr/local/src/apache_1.3.24
- leggere le istruzioni:
# less INSTALL
- configurare l'installazione. Installiamo tutto in
/usr/local/apache. Guardatevi anche il file README.configure che
contiene alcuni esempi di configurazione o l'help del configure:
# ./configure --help
# ./configure --prefix=/usr/local/apache \
--enable-module=most \
--enable-shared=max
- compilare e installare:
# make
# make install
...
+--------------------------------------------------------+
| You now have successfully built and installed the |
| Apache 1.3 HTTP server. To verify that Apache actually |
| works correctly you now should first check the |
| (initially created or preserved) configuration files |
| |
| /usr/local/apache/conf/httpd.conf |
| |
| and then you should be able to immediately fire up |
| Apache the first time by running: |
| |
| /usr/local/apache/bin/apachectl start |
| |
| Thanks for using Apache. The Apache Group |
| http://www.apache.org/ |
+--------------------------------------------------------+
- pulizia:
# make clean
- test:
# /usr/local/apache/bin/apachectl start
/usr/local/apache/bin/apachectl start: httpd started
# lynx http://localhost
- per avviarlo automaticamente aggiungere in /usr/local/etc/rc.d
lo script seguente (ad es. col nome apache-server.sh):
#!/bin/sh
cd /usr/local/apache/
case "$1" in
start)
if [ -x bin/apachectl ]; then
./bin/apachectl start > /dev/null && echo -n ' apache'
fi
;;
stop)
if [ -r /usr/local/apache/logs/httpd.pid ]; then
./bin/apachectl stop > /dev/null && echo -n ' apache'
fi
;;
*)
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
exit 64
;;
esac
settare poi il permesso di esecuzione:
# chmod +x apache-server.sh
- se tutte le richieste al server web vengono fatte all'interno di una sottorete,
si può limitare l'accesso per maggiore sicurezza. Ricordarsi di farlo sia per la document root che la directory cgi-bin. Nel mio caso la subnet
era 131.175.6.
<Directory "/usr/local/apache/htdocs">
...
#
# Controls who can get stuff from this server.
#
# Order allow,deny
# Allow from all
Order deny,allow
Deny from all
Allow from 127.0.0.1 131.175.6.
</Directory>
<Directory "/usr/local/apache/cgi-bin">
AllowOverride None
Options None
#Order allow,deny
#Allow from all
Order deny,allow
Deny from all
Allow from 127.0.0.1 131.175.6.
</Directory>