Changes

Jump to: navigation, search

SRA840 Lab5

2,585 bytes added, 23:31, 16 July 2012
no edit summary
= Milton =
# cd /usr/ports/www/apache22 # make config # make install
Then, add the lines:
### apache22_enable="YES" apache22_http_accept_enable="YES"###
In the file:
#vi /etc/rc.conf
And then, run the service:
#/usr/local/etc/rc.d/apache22 start
Verify if the server is running:
#netstat -tan And check if port 80 is open, then:
And check if port 80 is open, then '''#telnet localdomain localhost 80'''
If the connections is successful your server is running.
= Nestor =
I personally prefer yum and apt-get instead of FreeBSD "port" method. Because they have a great search function that let you search by keyword. Of course you can do the simulatr thing in FreeBSD with some ls command. It's just much more easier in Linux.
2009/04/11
As I mentioned in previous lab, it seems better to install step by step. First, install the latest Apache, it should be 2.2.9 now, and 2.2.11 is coming soon. Then install mod_perl. It seems that the latest perl5.8 or apache2.2 dosen't including mod_perl even if you do 'make config'. So, again, the best way is install apache first, make sure it's running, then go to mod_perl directory to make it. It would be better, if you're using vbox, because 'make' crashes all the time. It's better to install one by one.
== Mohak Vyas ==
<b># vim /usr/local/etc/apache22/httpd.conf</b>
== Gregory Katherine Masseau ==
Upon first attempting to install Apache, I chose Apache 2.2. This worked fine, and the installation of itself went alright - problems only occured when I attempted to build mod_python. It appears the version of mod_python included in the ports collection expects Apache 1.3. So, I went back, removed 2.2, and installed 2.1
It would be nice to have a version of mod_python in ports that works properly with Apache 2.2.
 
= Varinder Singh =
 
For Apche2.0 or Apache2.2 we need to install a mod_python3.3.1. By deafult it is not in the ports. So we have to down load the tar.tz and install from there.
 
Step how i did it.
 
1. Install the text based web browser lynx/elinks
#pkg_add -r elinks
 
2. Visit the web site http://www.modpython.org/
 
Downloaded the tar http://east.unified.net/apache/httpd/modpython/mod_python-3.3.1.tgz
 
3. tar -xvjf mod_python-3.3.1.tgz
4. cd mod_python-3.3.1
5. less README file
 
then according to instruction.
 
./configure --with-apxs=/usr/lcoal/apache/sbin/apxs
 
make
 
make install
 
to check weather it is installed?
 
#pkg_info | grep python
python25-2.5-2_3 An interpreted object-oriented programing language.
 
''Installation of mod_perl2 for Apache22''
cd /usr/ports/www/mod_perl2
 
make
 
make install
 
Apache is running Ok. But the python script is not working
I checked the error log for Apache in /var/log/httpd-error.log
 
"malformed header from script BAD header=Hello World: hello.py"
 
Oh Finally works. Have put the line header in CGI/Python script the following line after the #!/usr/bin/python line.
 
<b>print "Content-Type: text/html\n"</b>
 
now its working fine.
 
= Kezhong Liang =
 
Installing mod_perl is easy, I just use command "pkg_add -r mod_perl". But I cannot use this method to install
mod_python. The steps as below are my installing mod_pyhton method:
 
Firstly, I installed python.
 
cd /usr/ports/lang/python25
 
make install clean
 
rehash
 
The second, I installed mod_python
 
cd /usr/ports/distfiles
 
fetch http://apache.justdn.org/httpd/modpython/mod_python-3.2.10.tgz
 
tar zxvf mod_python-3.2.10.tgz
 
cd mod_python-3.2.10
 
./configure --with-apxs=/usr/local/sbin/apxs
 
./configure --with-apxs=/usr/local/sbin/apxs --with-python=/usr/local/bin/python2.5
 
make
 
make install
 
The third step, modified httpd.conf file and added the following line into group LoadModule
LoadModule python_module libexec/apache22/mod_python.so
 
Finally, I tested it, and it is OK.

Navigation menu