Difference between revisions of "SRA840 Lab6"

From CDOT Wiki
Jump to: navigation, search
(Created page with '=Varinder Singh= '''Installing php5''' I have tried to install the php5 as described in lab instructions. '''#/usr/ports/lang/make install clean''' It gives me the error messa...')
 
 
(22 intermediate revisions by 6 users not shown)
Line 1: Line 1:
=Varinder Singh=
+
= Katherine Masseau =
 +
 
 +
*1. What did you understand?
 +
 
 +
This lab was pretty straightforwards. It basically just involved installing packages and modifying conf files, both tasks with which I'm quite experienced and have a good understanding.
 +
 
 +
*2. What did you find difficult?
 +
 
 +
Nothing was really 'difficult', per se. Having to add a kernel module ('accf_http') to get Apache working was somewhat unexpected, but a solution was quickly found using a Google search.
 +
 
 +
*3. Write the steps to install mod_python and mod_perl on Apache.
 +
 
 +
1. Install the required software using the following command: 'cd /usr/ports/www/apache22 && make install distclean && cd /usr/ports/lang/php5 && make install distclean && cd /usr/ports/www/mod_perl2 && make install distclean'. When promped to provide options for PHP, select the box to build the Apache module.
 +
 
 +
2. Add your hostname to the 127.0.0.1 line in /ets/hosts.
 +
 
 +
3. Add these lines to /etc/rc.conf:
 +
 
 +
hostname="lab.bombshelter13.dyndns.org" to rc.conf
 +
apache22_enable="YES"
 +
 
 +
4. Configure apache. Near the start of /usr/local/etc/apache22/httpd.conf, add: 'Servername "<your hostname here>"'. At the end of the 'LoadModule' section, add the line: 'LoadModule perl_module libexec/apache22/mod_perl.so'. Find the 'DirectoryIndex' line, and add 'index.php' to the end of it. Near the bottom of the conf file, add these lines:
 +
 
 +
AddType application/x-httpd-php .php
 +
AddType application/x-httpd-php-source .phps
 +
   
 +
5. Add the line 'accf_http_load="YES"' to /boot/loader.conf.
 +
 
 +
6. Copy /usr/local/etc/php.ini-recommended to /usr/local/etc/php.ini.
 +
 
 +
7. Reboot, and you should have a working Apache installation with PHP and mod_perl.
 +
 
 +
 
 +
= Milton Paiva Neto =
 +
 
 +
*1. What did you understand?
 +
 
 +
How to install mod_python and mod_perl on apache.
 +
 
 +
*2. What did you find difficult to do?
 +
 
 +
The integration was kind of hard, because it involves two programs talking to each other, and some times depending of the versions we can get lot of incompatibilities problems.
 +
 
 +
*3. Write the steps to install mod_python and mod_perl on Apache.
 +
 
 +
*3.1 Installation - Mod_perl
 +
 
 +
#cd /usr/ports/www/mod_perl2/
 +
#make
 +
#make install
 +
 
 +
Integrating the module with apache22
 +
 
 +
Edit the file:
 +
#vi /usr/local/etc/apache22/httpd.conf
 +
And add the line below, after the modules section in the Apache configuration file.
 +
LoadModule perl_module libexec/apache22/mod_perl.so
 +
 
 +
Verify the installation process
 +
 
 +
To verify if the module was installed properly, type:
 +
#/usr/local/sbin/httpd -M
 +
And look for the line
 +
perl_module (shared)
 +
 
 +
*3.2 Installing mod_python
 +
 
 +
Download the mod_python from the http://modpython.org website. The current version while I write this document is 3.3.1.
 +
 
 +
http://apache.mirror.rafal.ca/httpd/modpython/mod_python-3.3.1.tgz
 +
 
 +
Install the module
 +
 
 +
#tar -zxvf mod_python-3.3.1.tgz
 +
#cd mod_python-3.3.1
 +
#./configure –with-apxs=/usr/local/sbin/apxs --enable-threads
 +
#make
 +
#make install
 +
 
 +
Set up apache for mod_python integration
 +
 
 +
#vi /usr/local/etc/apache/httpd.conf
 +
 
 +
Add the line following line in the apache configuration file:
 +
 
 +
LoadModule python_module libexec/apache22/mod_python.so
 +
 
 +
Verify the installation process
 +
 
 +
To verify if the module was installed properly, type:
 +
 
 +
#/usr/local/sbin/httpd -M
 +
 
 +
And look for the line:
 +
python_module (shared)
 +
 
 +
= Mohak Vyas =
 +
 
 +
I followed the instructions in the book to install php5 and did not had any problems.
 +
Following are the steps to install mod_python and mod_perl
 +
 
 +
Installing ''mod_python'':
 +
# cd /usr/ports/www/mod_python3
 +
# make install
 +
# make clean
 +
 
 +
Once the installation process is completed, it is time to integrate mod_python with Apache. So open the Apache config file and look for the part where you see all 'LoadModule' lines:
 +
# vim /usr/local/etc/apache2/httpd.conf
 +
 
 +
and add this line:
 +
 
 +
LoadModule  python_module  libexec/apache2/mod_python.so
 +
 
 +
Installing ''mod_perl'':
 +
# cd /usr/ports/www/mod_perl2
 +
# make
 +
# make install
 +
# make clean
 +
 
 +
Once the installation process is completed, it is time to integrate mod_perl with Apache. So open the Apache config file and look for the part where you see all 'LoadModule' lines:
 +
# vim /usr/local/etc/apache2/httpd.conf
 +
 
 +
and add this line:
 +
 
 +
LoadModule  perl_module  libexec/apache2/mod_perl.so
 +
 
 +
 
 +
= Varinder Singh =
 +
 
 
'''Installing php5'''
 
'''Installing php5'''
  
 
I have tried to install the php5 as described in lab instructions.
 
I have tried to install the php5 as described in lab instructions.
  '''#/usr/ports/lang/make install clean'''
+
  '''#/usr/ports/lang/php5/make install clean'''
  
 
It gives me the error message during installation OR Some time my FreeBSD virtual machine Crashes during installation. I am using Virtual box.I have tried installing new FreeBSD with standard option. It crashes at first time. Any hint, suggestions to this problem would be really appreciated.
 
It gives me the error message during installation OR Some time my FreeBSD virtual machine Crashes during installation. I am using Virtual box.I have tried installing new FreeBSD with standard option. It crashes at first time. Any hint, suggestions to this problem would be really appreciated.
 +
 +
The error message i got is..
 +
can't cd to /usr/ports/devel/autoconfig262/work/autoconfig-2.62:No such file or directory
 +
patch patch-autoconf.texi fail to apply cleanly.
 +
 +
Error code 1
 +
 +
Stop in /usr/ports/devel/autoconf262.
 +
 +
Error code 1
 +
 +
Stop in /usr/ports/lang/php5.
 +
 +
Error code 1
 +
Stop in /usr/ports/lang/php5.
 +
 +
'''Alternative'''
 +
 +
I have installed PHP5 with Pkg_add method
 +
 +
pkg_add -r php5
 +
 +
'''PHP configuration'''
 +
 +
A) Edit Apache configuration file for PHP Configuration.
 +
 +
Step1: Edit the httpd.conf file make Apache aware that PHP is installed.
 +
 +
vi usr/local/etc/apache22/httpd.conf
 +
 +
Step2: Put the following code in httpd.conf, near the DirectoryIndex
 +
 +
<IfModule dir_module>
 +
  DirectoryIndex index.php index.html
 +
</IfModule>
 +
 +
 +
Step 3: Insert the the following lines towards the end of the file
 +
 +
AddType application/x-httpd-php .php
 +
AddType application/x-httpd-php-source .phps
 +
 +
Step 4: Copy php.ini-recommended to php.ini
 +
 +
cp /usr/local/etc/php.ini-recommended /usr/local/etc/php.ini
 +
 +
'''B) Configure php.ini to save its sessions'''
 +
 +
Step1: Edit php.ini so PHP knows where to put its session files
 +
 +
vi usr/local/etc/php.ini
 +
 +
Step2: Uncomment the following line
 +
 +
session.save_path = "/tmp"
 +
 +
 +
'''C)Testing PHP Configuration''' 
 +
 +
Step1: It is Just displaying the file contents.I think its not running it. Means the command
 +
 +
elinks http://127.0.0.1/phpinfo.php 
 +
 +
Just show me the following output
 +
 +
<?php phpinfo(); ?>
 +
 +
Any help/suggestions are welcome
 +
 +
'''Finally Done it'''
 +
 +
As described before i got the following error messages while installing from ports.
 +
 +
can't cd to /usr/ports/devel/autoconfig262/work/autoconfig-2.62:No such file or directory
 +
patch patch-autoconf.texi fail to apply cleanly.
 +
Error code 1
 +
Stop in /usr/ports/devel/autoconf262.
 +
 +
I again looked at those error messages. I installed the package autoconfig262 (i dont know why we need this package. At least we need this package to install PHP5. So i did it with pkg_add -r autoconfig262 and again tried php5 with ports methods and every thing is fine.
 +
 +
PHP5 and Apache are fine. Great!.
 +
 +
= Nestor the Best =
 +
What did you understand?
 +
i understand install packages/port one by one instead of install every thing at the same time in sysinstall. And sysinstall dosen't take care dependency very well.
 +
 +
What did you find difficult to do?
 +
'make' crashes a lot during compiling. And I had trouble with dependency, BIG TIME!! I had to remove, then install again, and it ends up didn't work. So I use my backup hard disk image to do it step by step. It was fun!
 +
 +
Write the steps to install mod_python and mod_perl on Apache.
 +
1. Installing Perl module, mod_perl
 +
 cd /usr/ports/www/mod_perl2/
 +
 make
 +
 make install
 +
 +
2. Installing Python module, mod_python
 +
 cd /usr/ports/www/mod_python3/
 +
 make
 +
 make install
 +
 +
3. Checking Installed Modules
 +
 httpd –M
 +
 +
4. Assuming the apache was previous configured accurately, now we should configure modules in httpd.conf
 +
 vi /usr/local/etc/apache22/httpd.conf
 +
 Search the word “LoadModule” then change or add the following lines
 +
<pre>
 +
LoadModule perl_module libexec/apache22/mod_perl.so
 +
LoadModule php5_module libexec/apache22/libphp5.so
 +
LoadModule python_module libexec/apache22/mod_python.so
 +
 +
AddHandler php5-script php
 +
AddType text/html php
 +
</pre>
 +
 +
=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.

Latest revision as of 22:33, 16 July 2012

Katherine Masseau

  • 1. What did you understand?

This lab was pretty straightforwards. It basically just involved installing packages and modifying conf files, both tasks with which I'm quite experienced and have a good understanding.

  • 2. What did you find difficult?

Nothing was really 'difficult', per se. Having to add a kernel module ('accf_http') to get Apache working was somewhat unexpected, but a solution was quickly found using a Google search.

  • 3. Write the steps to install mod_python and mod_perl on Apache.

1. Install the required software using the following command: 'cd /usr/ports/www/apache22 && make install distclean && cd /usr/ports/lang/php5 && make install distclean && cd /usr/ports/www/mod_perl2 && make install distclean'. When promped to provide options for PHP, select the box to build the Apache module.

2. Add your hostname to the 127.0.0.1 line in /ets/hosts.

3. Add these lines to /etc/rc.conf:

hostname="lab.bombshelter13.dyndns.org" to rc.conf apache22_enable="YES"

4. Configure apache. Near the start of /usr/local/etc/apache22/httpd.conf, add: 'Servername "<your hostname here>"'. At the end of the 'LoadModule' section, add the line: 'LoadModule perl_module libexec/apache22/mod_perl.so'. Find the 'DirectoryIndex' line, and add 'index.php' to the end of it. Near the bottom of the conf file, add these lines:

AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps

5. Add the line 'accf_http_load="YES"' to /boot/loader.conf.

6. Copy /usr/local/etc/php.ini-recommended to /usr/local/etc/php.ini.

7. Reboot, and you should have a working Apache installation with PHP and mod_perl.


Milton Paiva Neto

  • 1. What did you understand?

How to install mod_python and mod_perl on apache.

  • 2. What did you find difficult to do?

The integration was kind of hard, because it involves two programs talking to each other, and some times depending of the versions we can get lot of incompatibilities problems.

  • 3. Write the steps to install mod_python and mod_perl on Apache.
  • 3.1 Installation - Mod_perl
#cd /usr/ports/www/mod_perl2/
#make
#make install

Integrating the module with apache22

Edit the file:

#vi /usr/local/etc/apache22/httpd.conf
And add the line below, after the modules section in the Apache configuration file.
LoadModule perl_module libexec/apache22/mod_perl.so

Verify the installation process

To verify if the module was installed properly, type:
#/usr/local/sbin/httpd -M
And look for the line
perl_module (shared)
  • 3.2 Installing mod_python

Download the mod_python from the http://modpython.org website. The current version while I write this document is 3.3.1.

http://apache.mirror.rafal.ca/httpd/modpython/mod_python-3.3.1.tgz

Install the module

#tar -zxvf mod_python-3.3.1.tgz
#cd mod_python-3.3.1
#./configure –with-apxs=/usr/local/sbin/apxs --enable-threads
#make 
#make install

Set up apache for mod_python integration

#vi /usr/local/etc/apache/httpd.conf

Add the line following line in the apache configuration file:

LoadModule python_module libexec/apache22/mod_python.so

Verify the installation process

To verify if the module was installed properly, type:

#/usr/local/sbin/httpd -M

And look for the line:

python_module (shared)

Mohak Vyas

I followed the instructions in the book to install php5 and did not had any problems. Following are the steps to install mod_python and mod_perl

Installing mod_python:

  1. cd /usr/ports/www/mod_python3
  2. make install
  3. make clean

Once the installation process is completed, it is time to integrate mod_python with Apache. So open the Apache config file and look for the part where you see all 'LoadModule' lines:

  1. vim /usr/local/etc/apache2/httpd.conf

and add this line:

LoadModule python_module libexec/apache2/mod_python.so

Installing mod_perl:

  1. cd /usr/ports/www/mod_perl2
  2. make
  3. make install
  4. make clean

Once the installation process is completed, it is time to integrate mod_perl with Apache. So open the Apache config file and look for the part where you see all 'LoadModule' lines:

  1. vim /usr/local/etc/apache2/httpd.conf

and add this line:

LoadModule perl_module libexec/apache2/mod_perl.so


Varinder Singh

Installing php5

I have tried to install the php5 as described in lab instructions.

#/usr/ports/lang/php5/make install clean

It gives me the error message during installation OR Some time my FreeBSD virtual machine Crashes during installation. I am using Virtual box.I have tried installing new FreeBSD with standard option. It crashes at first time. Any hint, suggestions to this problem would be really appreciated.

The error message i got is.. can't cd to /usr/ports/devel/autoconfig262/work/autoconfig-2.62:No such file or directory patch patch-autoconf.texi fail to apply cleanly.

Error code 1

Stop in /usr/ports/devel/autoconf262.

Error code 1

Stop in /usr/ports/lang/php5.

Error code 1 Stop in /usr/ports/lang/php5.

Alternative

I have installed PHP5 with Pkg_add method

pkg_add -r php5

PHP configuration

A) Edit Apache configuration file for PHP Configuration.

Step1: Edit the httpd.conf file make Apache aware that PHP is installed.

vi usr/local/etc/apache22/httpd.conf

Step2: Put the following code in httpd.conf, near the DirectoryIndex

<IfModule dir_module>
  DirectoryIndex index.php index.html
</IfModule>


Step 3: Insert the the following lines towards the end of the file

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Step 4: Copy php.ini-recommended to php.ini

cp /usr/local/etc/php.ini-recommended /usr/local/etc/php.ini

B) Configure php.ini to save its sessions

Step1: Edit php.ini so PHP knows where to put its session files

vi usr/local/etc/php.ini

Step2: Uncomment the following line

session.save_path = "/tmp"


C)Testing PHP Configuration

Step1: It is Just displaying the file contents.I think its not running it. Means the command

elinks http://127.0.0.1/phpinfo.php  

Just show me the following output

<?php phpinfo(); ?>

Any help/suggestions are welcome

Finally Done it

As described before i got the following error messages while installing from ports.

can't cd to /usr/ports/devel/autoconfig262/work/autoconfig-2.62:No such file or directory
patch patch-autoconf.texi fail to apply cleanly.
Error code 1
Stop in /usr/ports/devel/autoconf262.

I again looked at those error messages. I installed the package autoconfig262 (i dont know why we need this package. At least we need this package to install PHP5. So i did it with pkg_add -r autoconfig262 and again tried php5 with ports methods and every thing is fine.

PHP5 and Apache are fine. Great!.

Nestor the Best

What did you understand? i understand install packages/port one by one instead of install every thing at the same time in sysinstall. And sysinstall dosen't take care dependency very well.

What did you find difficult to do? 'make' crashes a lot during compiling. And I had trouble with dependency, BIG TIME!! I had to remove, then install again, and it ends up didn't work. So I use my backup hard disk image to do it step by step. It was fun!

Write the steps to install mod_python and mod_perl on Apache. 1. Installing Perl module, mod_perl  cd /usr/ports/www/mod_perl2/  make  make install

2. Installing Python module, mod_python  cd /usr/ports/www/mod_python3/  make  make install

3. Checking Installed Modules  httpd –M

4. Assuming the apache was previous configured accurately, now we should configure modules in httpd.conf  vi /usr/local/etc/apache22/httpd.conf  Search the word “LoadModule” then change or add the following lines

 LoadModule perl_module libexec/apache22/mod_perl.so
 LoadModule php5_module libexec/apache22/libphp5.so 
 LoadModule python_module libexec/apache22/mod_python.so

 AddHandler php5-script php 
 AddType text/html php

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.