×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Web server

Howto install a web-server by OpenBsdRulez
Posted: 20 Sep 03

############################# 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';         

 

Back to Linux (server) FAQ Index
Back to Linux (server) Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close