Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Howto install a web-server

Web server

Howto install a web-server

by  OpenBsdRulez  Posted    (Edited  )
############################# web server ###################
appache is already preinstalled so this is just config
=> edit /etc/rc.conf.local,
#vi /etc/rc.conf.local
(add line)
httpd_flags=""

# apachectl start

For webserver to outside the firewall must be changed:
(under line)
pass in on $EXTIF inet proto tcp from any to any port 22 flags S/SA modulate state
(add this line)
pass in on $EXTIF inet proto tcp from any to any port 80 flags S/SA modulate state


If you also want MySQL PHP install the following
############################################################
# manual mysql/php/phpmyadmin #
############################################################


############################################################
# install mysql

env SUBPACKAGE=-server make install clean


############################################################
# install/activate/test php

cd /usr/ports/www/php4/core && make install clean
cd ../extensions && env FLAVOR="no_x11 no_pgsql no_sybase_ct" make install clean
pkg_add /usr/ports/packages/i386/www/php4-mysql-4.2.3.tgz

/usr/local/sbin/phpxs -a mysql
/usr/local/sbin/phpxs -s
cp /usr/local/share/doc/php4/php.ini-recommended /var/www/conf/php.ini
apachectl restart

echo '<?php phpinfo() ?>'> /var/www/htdocs/test.php
lynx http://ip.or.url.webserver/test.php


############################################################
# download/install phpmyadmin

wget http://cesnet.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.5.3-php.tar.gz
cp phpMyAdmin-2.5.3-php.tar.gz /var/www/htdocs/
cd /var/www/htdocs/ && tar zxvf phpMyAdmin-2.5.3-php.tar.gz
mv phpMyAdmin-2.5.3 phpmyadmin


############################################################
# start mysql

cp /usr/local/share/mysql/my-small.cnf /etc/my.cnf
vi /etc/my.cnf

# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/www/var/run/mysql/mysql.sock

# The MySQL server
[mysqld]
port = 3306
socket = /var/www/var/run/mysql/mysql.sock


mkdir -p /var/www/var/run/mysql/
chown mysql:mysql /var/www/var/run/mysql/

vi /etc/rc.local

if [ -x /usr/local/bin/safe_mysqld ]; then
echo -n " mysqld"; /usr/local/bin/safe_mysqld --user=mysql --log &
fi

/usr/local/bin/safe_mysqld --user=mysql --log &


############################################################
# add mysql-user/test mysql

/usr/local/bin/mysqladmin -u root password passwd

/usr/local/bin/mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6 to server version: 3.22.32
Type 'help' for help.

mysql> show databases;
+----------+
| Database |
+----------+
| mysql |
| test |
+----------+


############################################################
# config phpmyadmin

vi /var/www/htdocs/phpmyadmin/config.inc.php

$cfg['PmaAbsoluteUri'] = 'http://ip.or.url.webserver/phpMyAdmin/';
$cfg['blowfish_secret'] = 'Put a secret pass phrase here.';

// The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0].
// You can disable a server config entry by setting host to '.
$i++;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = ';
$cfg['Servers'][$i]['socket'] = '/var/run/mysql/mysql.sock';
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['compress'] = FALSE;

$cfg['Servers'][$i]['controluser'] = 'root';

$cfg['Servers'][$i]['controlpass'] = 'passwd';

$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'passwd';

$cfg['Servers'][$i]['only_db'] = ';




$cfg['Servers'][$i]['verbose'] = 'ip.or.url.webserver';

Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top