Theotime
25/02/2009, 17h56
Quelqu'un a le même pour Debian ? Ou alors celui ci est compaptible ?
$HTTP["host"] == "www.site1.com" { server.document-root = "/home/htdocs/site1.com/" $HTTP["url"] == "/" { proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 8090 ) ) ) } proxy.server = ( ".php" => ( ( "host" => "127.0.0.1", "port" => 8070 ) ) ) }
root@ns10000:~# cd /usr/local/apache2/bin root@ns10000:/usr/local/apache2/bin# ./apachectl start root@ns10000:/usr/local/apache2/bin#
root@ns10000:/usr/local/apache2/bin# cd ../logs root@ns10000:/usr/local/apache2/bin# tail error_log [Mon Dec 31 14:24:54 2007] [notice] Apache configured -- resuming normal operations
root@ns10000:~# cd /home/compilation/ root@ns10000:/home/compilation# wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.1.tar.gz root@ns10000:/home/compilation# tar xvf proftpd-1.3.1.tar.gz root@ns10000:/home/compilation# cd proftpd-1.3.1 root@ns10000:/home/compilation# ./configure --help #faites vos choix de compilation ou configurer directement pour les choix par défaut root@ns10000:/home/compilation# make && make install
root@ns10000:~#cat /etc/shells /bin/bash root@ns10000:~#
root@ns10000:~# echo "/bin/false" >>/etc/shells
227.w86-198.abo.wanadoo.fr[86.198.198.198]): USER ftp_admin (Login failed): Invalid shell: '/bin/false'
root@ns10000:~# groupadd ftpusers root@ns10000:~# useradd -s /bin/false -d /home/htdocs/ -g ftpusers ftp_admin root@ns10000:~# passwd ftp_admin root@ns10000:~# useradd -s /bin/false -d /home/htdocs/site1.com -g ftpusers ftp_admin_site1 root@ns10000:~# passwd ftp_admin_site1
nano /etc/ssh/sshd_config
DenyUsers ftp_admin, ftp_admin_site1
root@ns10000:~# cat /etc/passwd | cut -f1 -d: > /etc/ftpusers root@ns10000:~# echo anonymous >> /etc/ftpusers root@ns10000:~# nano /etc/ftpusers #Enlever les users FTP root@ns10000:~# cat /etc/ftpusers root bin daemon adm lp sync shutdown halt mail news uucp operator games smmsp rpc sshd gdm pop nobody anonymous ... etc
root@ns10000:~# nano /etc/proftpd.conf
ServerName "ns1000-FTP"
ServerType standalone
DefaultServer on
# Set the user and group under which the server will run.
User nobody
Group nogroup
SystemLog /var/log/proftpd.log
#To cause every FTP user to be "jailed" (chrooted) into their home
DefaultRoot ~
# Autoriser l'usage de /etc/ftpusers
UseFtpUsers on
# Bar use of SITE CHMOD by default
DenyAll
# Configuration des users
AllowUser ftp_admin
DenyAll
AllowUser ftp_admin
DenyAll
AllowUser ftp_admin
AllowUser ftp_admin_site1
DenyAll
AllowUser ftp_admin
AllowUser ftp_admin_site1
DenyAll
root@ns10000:/home/htdocs# chown -R ftp_admin:ftpusers * root@ns10000:/home/htdocs# chmod -R u=rwX,g=rwX,o=r-X *
#On active les modules que l'on souhaite server.modules = ( "mod_rewrite", "mod_redirect", "mod_access", "mod_status", "mod_simple_vhost", "mod_proxy", "mod_compress", "mod_expire" ) #Paramètres primaires server.document-root = "/home/htdocs" server.username = "lighttpd" server.groupname = "nogroup" #Mod_compress : mise en place d'un cache de compression sur certain type mime pour éviter de compresser à chaque fois compress.filetype = ("text/html", "text/plain", "text/css", "text/javascript", "text/xml") #N'oubliez pas de créer le répertoire et lui donner les bons droits (idem que pour le fichier et répertoire de log) compress.cache-dir = "/home/lighttpd_cache/" #Ce qu'on a fait en haut server.errorlog = "/var/log/lighttpd/error.log" #Trés important, n'envoyez pas vos fichiers php non interprété ! Lighttpd ne dessert ici que le statique et reconnait les fichiers php qu'en tant que texte. static-file.exclude-extensions = ( ".php", ".inc", "htaccess", "htpasswd" ) #Frontal server.port = 80 # #Quelques règles d'exemples # #redirection vers le www $HTTP["host"] =~ "^site1\.com" { url.redirect = ("(.*)" => "http://www.site1.com$1") } $HTTP["host"] =~ "^site2\.net" { url.redirect = ("(.*)" => "http://www.site2.net$1") } $HTTP["host"] == "www.site1.com" { server.document-root = "/home/htdocs/site1.com/" #Nous laissons Apache desservir les fichiers index.* Cf. post 8 de dam23 et post 9 $HTTP["url"] == "/" { proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 8070 ) ) ) } #Forward du contenu dynamique (fichiers php) vers apache proxy.server = ( ".php" => ( ( "host" => "127.0.0.1", "port" => 8070 ) ) ) } $HTTP["host"] == "www.site2.net" { server.document-root = "/home/htdocs/site2.net/" #Nous laissons Apache desservir les fichiers index.* Cf. post 8 de dam23 et post 9 $HTTP["url"] == "/" { proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 8080 ) ) ) } proxy.server = ( ".php" => ( ( "host" => "127.0.0.1", "port" => 8080 ) ) ) }
root@ns10000:~# /usr/local/sbin/lighttpd -f /etc/lighttpd.conf root@ns10000:~# ps aux | grep light lighttpd 17972 0.0 0.1 4464 3172 ? S Dec10 0:35 /usr/local/sbin/lighttpd -f /etc/lighttpd.conf
root@ns10000:~# tail /var/log/lighttpd/error.log
slackpkg install rpm
root@ns10000:/home/compilation# wget http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-server-5.0.45-0.i386.rpm/from/http://mir2.ovh.net/ftp.mysql.com/ root@ns10000:/home/compilation# wget http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-client-5.0.45-0.i386.rpm/from/http://mir2.ovh.net/ftp.mysql.com/ root@ns10000:/home/compilation# wget http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-devel-5.0.45-0.i386.rpm/from/http://mirrors.ircam.fr/pub/mysql/ root@ns10000:/home/compilation# wget http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-shared-5.0.45-0.i386.rpm/from/http://mirrors.ircam.fr/pub/mysql/
root@ns10000:/home/compilation# rpm -Uvh --nodeps --force MySQL-server-5.0.45-0.i386.rpm root@ns10000:/home/compilation# rpm -Uvh --nodeps --force MySQL-client-5.0.45-0.i386.rpm root@ns10000:/home/compilation# rpm -Uvh --nodeps --force MySQL-devel-5.0.45-0.i386.rpm root@ns10000:/home/compilation# rpm -Uvh --nodeps --force MySQL-shared-5.0.45-0.i386.rpm
root@ns10000:~# userdel mysql root@ns10000:~# groupdel mysql root@ns10000:~# groupadd mysql root@ns10000:~# useradd -g mysql mysql root@ns10000:~# usermod -d /var/lib/mysql -s /bin/false mysql root@ns10000:~# cd /var/lib root@ns10000:/var/lib# chown -R mysql:mysql /var/lib/mysql
root@ns10000:~# mkdir /home/mysql root@ns10000:~# chown mysql:mysql /home/mysql
nano /etc/my.cnf
[client] socket = /var/lib/mysql/mysql.sock [mysqld] long_query_time = 2 datadir= /home/mysql log-warnings=2 log-error=/home/mysql/mysql.log socket = /var/lib/mysql/mysql.sock
#sh /usr/bin/mysql_install_db
#mysqladmin -u root password 'motdepasse'
root@ns10000:/etc/rc.d# sh /etc/rc.d/mysql.server start --skip-innodb --skip-bdb --log-warnings=2 & root@ns10000:/etc/rc.d# Starting MySQL SUCCESS!
root@ns10000:~# slackpkg install libxml root@ns10000:~# slackpkg install libxml2 root@ns10000:~# slackpkg install libpng
root@ns10000:/home/compilation# wget http://curl.haxx.se/download/curl-7.17.1.tar.gz && cd curl-7.17.1 && ./configure && make && make install root@ns10000:/home/compilation# wget ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz && jpegsrc.v6b && ./configure --enable-static --enable-shared --prefix=/usr && make && make install
root@ns10000:/home/compilation# wget http://fr3.php.net/get/php-5.2.5.tar.gz/from/fr.php.net/mirror root@ns10000:/home/compilation# tar xvf php-5.2.5.tar.gz && cd php-5.2.5 root@ns10000:/home/compilation/php-5.2.5# ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/lib/mysql --with-libxml-dir=/usr/local/lib --with-gd --with-curl --with-zlib-dir --with-png-dir --with-jpeg-dir --without-sqlite --enable-ftp --enable-zip --enable-sockets --enable-exif --enable-mbstring --disable-ipv6 --disable-cgi --disable-short-tags root@ns10000:/home/compilation/php-5.2.5# make && make test
root@ns10000:/home/compilation/php-5.2.5# make install
LoadModule php5_module modules/libphp5.so #apache ne sert pas de statique, mais nous l'utilisons pour desservir les fichiers index DirectoryIndex index.html index.php AddType application/x-httpd-php .php
# ./configure ... CFLAGS="-march=prescott -O3 -pipe -fomit-frame-pointer"
# ./configure ... CFLAGS="-march=core2 -O3 -pipe -fomit-frame-pointer"
export CFLAGS="-march=prescott -O3 -pipe -fomit-frame-pointer"
# nano /etc/profile
# /etc/profile: This file contains system-wide defaults used by # all Bourne (and related) shells. # Set the values for some environment variables: #[...] export CFLAGS="-march=prescott -O3 -pipe -fomit-frame-pointer" export CXXFLAGS="${CFLAGS}" #[...]
slackpkg install zlib
root@ns10000:~# mkdir /home/compilation root@ns10000:~# cd /home/compilation root@ns10000:/home/compilation# wget http://apache.fastorama.com/dist/httpd/httpd-2.0.61.tar.gz root@ns10000:/home/compilation# tar xvf httpd-2.0.61.tar.gz root@ns10000:/home/compilation# cd httpd-2.0.61 root@ns10000:/home/compilation/httpd-2.0.61# make clean
root@ns10000:/home/compilation/httpd-2.0.61#./configure --prefix=/usr/local/apache2 --enable-so --enable-deflate --enable-headers --disable-actions --disable-imap --disable-userdir root@ns10000:/home/compilation/httpd-2.0.61#make
root@ns10000:/home/compilation/httpd-2.0.61# ./httpd -l Compiled in modules: core.c mod_access.c mod_auth.c mod_include.c mod_deflate.c mod_log_config.c mod_env.c mod_headers.c mod_setenvif.c prefork.c http_core.c mod_mime.c mod_status.c mod_autoindex.c mod_negotiation.c mod_dir.c mod_alias.c mod_so.c
root@ns10000:/home/compilation/httpd-2.0.61# make install
root@ns10000:/home# groupadd www root@ns10000:/home# useradd httpd -g nogroup -s /bin/false root@ns10000:/home# usermod -L httpd #lock le compte
#mkdir /home/htdocs #mkdir /home/htdocs/site1.com #mkdir /home/htdocs/site2.net
nano /usr/local/apache2/conf/httpd.conf
User httpd Group nogroup #Nous ne desservons que du PHP, nous pouvons désactiver le keepalive KeepAlive Off #Port 8070 sera destiné au virtualhost pour site1.com Listen 127.0.0.1:8070 #Port 8080 sera destiné au virtualhost pour site2.net Listen 127.0.0.1:8080 DocumentRoot "/home/htdocs" NameVirtualHost 127.0.0.1:8070 NameVirtualHost 127.0.0.1:8080DocumentRoot /home/htdocs/site1.com ServerName www.site1.com DocumentRoot /home/htdocs/site2.net ServerName www.site2.net
root@ns10000:/home/compilation# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.4.tar.gz root@ns10000:/home/compilation# tar xvf pcre-7.4.tar.gz root@ns10000:/home/compilation# cd pcre-7.4/ root@ns10000:/home/compilation/pcre-7.4/# .configure --help #Choisissez vos options spécifiques ou simplement ./configure root@ns10000:/home/compilation/pcre-7.4/# make && make install
root@ns10000:/home/compilation# wget http://www.lighttpd.net/download/lighttpd-1.4.18.tar.gz root@ns10000:/home/compilation# tar xvf lighttpd-1.4.18.tar.gz root@ns10000:/home/compilation# cd lighttpd-1.4.18 root@ns10000:/home/compilation/lighttpd-1.4.18# ./configure --disable-ipv6 --with-bzip2 --with-pcre
root@ns10000:/home/compilation/lighttpd-1.4.18# make && make install
root@ns10000:/home# useradd lighttpd -g nogroup -s /bin/false root@ns10000:/home# usermod -L lighttpd #lock le compte
root@ns10000:/home# cd /var/log/ root@ns10000:/var/log# mkdir lighttpd root@ns10000:/var/log# touch error.log root@ns10000:/var/log# chown lighttpd lighttpd/ root@ns10000:/var/log# chmod 744 lighttpd/
nano /etc/lighttpd.conf
#ping ns10000 ping: unknown host ns10000
#cat /etc/hosts 127.0.0.1 localhost 91.121.14.48 2-ns10000.ovh.net ns10000
127.0.0.1 localhost 91.121.14.48 ns10000.ovh.net ns10000
#date
#hwclock --show select() to /dev/rtc to wait for clock tick timed out
#hwclock --systohc --debug hwclock from util-linux-2.12p Using /dev/rtc interface to clock. Last drift adjustment done at 1137365083 seconds after 1969 Last calibration done at 1137365083 seconds after 1969 Hardware clock is on UTC time Assuming hardware clock is kept in UTC time. Waiting for clock tick... select() to /dev/rtc to wait for clock tick timed out ...got clock tick
#hwclock --set --date="09/11/07 13:56:00" --utc --debug Issuing date command: date --date="09/11/07 13:56:00" +seconds-into-epoch=%s response from date command = seconds-into-epoch=1189511760 date string 09/11/07 13:56:00 equates to 1189511760 seconds since 1969. hwclock from util-linux-2.12p Using /dev/rtc interface to clock. Last drift adjustment done at 1137365083 seconds after 1969 Last calibration done at 1137365083 seconds after 1969 Hardware clock is on UTC time Assuming hardware clock is kept in UTC time. Waiting for clock tick... select() to /dev/rtc to wait for clock tick timed out ...got clock tick
select() to /dev/rtc to wait for clock tick timed out
#hwclock --help | grep directisa --directisa access the ISA bus directly instead of /dev/rtc
root@ns10000:/# hwclock --show --directisa root@ns10000:/#
# useradd -g users -G wheel -s /bin/bash toto # passwd toto
/etc/ssh/sshd_config
Port 8655 PermitRootLogin no PermitEmptyPasswords no AllowUsers toto SyslogFacility AUTH LogLevel INFO
root@ns10000:/etc/rc.d# ./rc.sshd restart
#cd /home/
#wget http://heanet.dl.sourceforge.net/sou...1-noarch-2.tgz
#installpkg slackpkg-2.61-noarch-2.tgz
gpg package not found! Please disable GPG in /etc/slackpkg/slackpkg.conf or install the gnupg package. To disable GPG, edit slackpkg.conf and change the value of the CHECKGPG variable to off - you can see an example in the original slackpkg.conf.new file distributed with slackpkg.
/etc/slackpkg/mirrors
http://ftp.belnet.be/packages/slackware/slackware-10.2/
#slacpkg update
#slackpkg upgrade-all
# slackpkg search glib The list below shows all packages with the selected pattern. ... [ installed ] - glibc-solibs-2.3.5-i486-6_slack10.2 [ installed ] - glibc-zoneinfo-2.3.5-noarch-8_slack10.2 [uninstalled] - glib-1.2.10-i386-2 [uninstalled] - glib2-2.6.6-i486-1 [uninstalled] - glibc-2.3.5-i486-5 [uninstalled] - glibc-i18n-2.3.5-noarch-5 [uninstalled] - glibc-profile-2.3.5-i486-5
# slackpkg install glib # slackpkg install glib2 # slackpkg install glibc
# slackpkg install gcc
# slackpkg search gcc The list below shows all packages with the selected pattern. [ installed ] - gcc-4.1.2-i486-1 [ installed ] - gcc-g++-4.1.2-i486-1 [uninstalled] - gcc-gfortran-4.1.2-i486-1 [uninstalled] - gcc-gnat-4.1.2-i486-1 [uninstalled] - gcc-java-4.1.2-i486-1 [uninstalled] - gcc-objc-4.1.2-i486-1 [uninstalled] - gcc-g77-3.4.6-i486-1
# uname -r 2.6.21.5-grsec-xxxx-grs-ipv4-32
#slackpkg remove kernel-headers #slackpkg remove kernel-source
cd /usr/src/ && ls -lh
root@ns10000:/usr/src# wget http://www.eu.kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.5.tar.gz root@ns10000:/usr/src# tar xvf linux-2.6.21.5.tar.gz root@ns10000:/usr/src# ln -s /usr/src/linux-2.6.21.5 linux
root@ns10000:/usr/src# cd linux/ root@ns10000:/usr/src# make mrproper
# cd /usr/include root@ns10000:/usr/include# ln -s /usr/src/linux/include/linux linux root@ns10000:/usr/include# ln -s /usr/src/linux/include/asm-i386 asm root@ns10000:/usr/include# ln -s /usr/src/linux/include/asm-generic asm-generic