__________________________
STEP 1: PREPARE ENVIRONMENT
Creating www Group
echo "www:x:199:" >> /etc/group
Creating www User
echo "www:x:199:199:www:/www:/bin/sh" >> /etc/passwd
Setup PATH in /etc/profile
echo "export PATH=\$PATH:/usr/pkg/bin:usr/pkg/sbin" >> /etc/profile
Setup CS_LIBPATH in /etc/rc.d/rc.local
echo "setconf CS_LIBPATH \$(getconf CS_LIBPATH):/usr/pkg/lib" >> /etc/rc.d/rc.local
Download pkgsrc project. To get pkgsrc, write this line into a single line:
svn checkout --username <username> http://community.qnx.com/svn/repos/pkgsrc/HEAD_650
(username is your registrated email address in qnx.com, you can register for free)
Now your environment is ready for install. Reboot QNX and go to STEP 2.
Bootstraping pkgsrc
cd /HEAD_650
(cd pkgsrc/bootstrap && ./bootstrap --workdir HEAD_650/pkgsrc/bootstrap/work)
Preparing Apache 2.2
cd /HEAD_650/pkgsrc/www/apache22
bmake distinfo
bmake clean
Compiling and Linking and Installing Apache 2.2
cd /HEAD_650/pkgsrc
(cd www/apache22 && /usr/pkg/bin/bmake install)
Configuring dinamic .so modules in Apache 2.2
cd /HEAD_650/pkgsrc/www/apache22/work/httpd-2.2.23/
./configure --enable-so
Installing Apache 2.2.
cd /HEAD_650/pkgsrc
(cd www/apache22 && /usr/pkg/bin/bmake install)
Installing PHP5 Module for Apache 2.2
cd /HEAD_650/pkgsrc
(cd www/ap-php && bmake install)
Preparing Apache 2.2 to start when QNX boots
cp /usr/pkg/share/examples/rc.d/apache /etc/rc.d/apache
echo "/etc/rc.d/apache start" >> /etc/rc.d/rc.local
Installation Finished. Now go to STEP 3
Before starting Apache remember to configure your network.
Network settings must be in MANUAL MODE. DHCP is not available,
For example:
IP: 10.0.2.99 (or any proper IP address)
Netmask 255.255.255.0
Host Name: qnx650 (or any proper name EXCEPT localhost)
Name Servers: 10.0.2.1
Default Gateway: 10.0.2.1
Once the network is configured to manual mode, add your hostname to /etc/hosts
For example:
10.0.2.99 qnx650
(where 10.0.2.99 is a fixed IP Address and qnx650 is our hostname)
Edit apache config file according to the Apache22 help descriptions:
The Important contents of Apache2.2 config file: /usr/pkg/etc/httpd/httpd.conf include:
ServerRoot "/usr/pkg"
Listen 10.0.2.99:80
User www
Group www
ServerAdmin you@example.com
ServerName 10.0.2.99 (use your localhost IP address)
DocumentRoot "/usr/pkg/share/httpd/htdocs"
Also add the following lines to the appropiate sections to enable PHP 5 module:
LoadModule php5_module lib/httpd/mod_php5.so
In the "AddHandler" section add:
AddHandler application/x-httpd-php .php
To start apache manually, enter:
. /etc/rc.d/apache start
To stop apache enter:
. /etc/rc.d/apache stop
You should be able to access http://your-ip/index.html
In case of any fault, please see the error log file in /var/log/httpd/error_log