Archive

Posts Tagged ‘apache’

Perl web support on Ubuntu 8.10 Server

April 29th, 2009 Arthur Gressick No comments

I had this project where we need to add PERL support in a website folder called cgi-bin. Here is how I got it working and what changes I need to to make.

Install PERL if not already installed.

apt-get install perl

Apache configuration: load the following in the apache mods-enabled

cd /etc/apache2/mod-enabled
ln -s ../mods-available/perl.conf
ln -s ../mods-available/perl.load

Website configuration:

<VirtualHost *:80>
        ServerName www.YOURHOST.com
        ServerAdmin name@YOURHOST.com
        DocumentRoot "/home/USER/WEB_root"
        DirectoryIndex index.html index.php default.php index.htm
        ErrorLog /var/log/apache2/YOURHOST_error_log
# information in here
        ScriptAlias /cgi-bin/ /home/USER/WEB_root/cgi-bin/
        <Directory /home/USER/WEB_root/cgi-bin/>
                Options ExecCGI
                AddHandler cgi-script cgi pl
        </Directory>
# Rest of your information
</VirtualHost>

Ubuntu 8.10 Apache mod_ajp to Tomcat6

April 15th, 2009 Arthur Gressick No comments

So I had this project where we needed to have the Tomcat handle the JSP pages from a website. I had to install a few mod to apache and then setup the ProxyPass to handle the requests. Now I may have enabled too many mods so you can activate them one at a time until you get it working. Here are the mods I added to Ubuntu 8.10 standard install:

proxy_ajp.load, proxy_balancer, proxy_connect.load, proxy_http.load, proxy.load

AGAIN, I may have activated too many but I will need some of them for things like ruby later. I did not alter any of the information in these files.

Here is the site config I added to the virtual host file:

<IfModule mod_proxy.c>
     ProxyPass /DIRECTORY ajp://localhost:8009/DIRECTORY
</IfModule>

Where the directory pass through is the same as /webapps/DIRECTORY on Tomcat6

Next we had to make some changed to some of the files which might not apply to your application:

nano etc/tomcat6/policy.d/04webapps.policy

In that file we had to make some changes to the read and write:

permission java.io.FilePermission "/FOLDER/APPLICATION/sessions/*", "read, write";

Note that we put in the application in the home folder of a user and then did an “ln -s” into the TomCat6 webapps folder so that the user could change the files for the application. It needed to write session information to a folder and have permissions.

I hope this helps anyone trying to get things going.

Categories: Ubuntu 8.x Server, java Tags: , , ,

Wildcard SSL multiple sites under same IP

February 23rd, 2009 Arthur Gressick No comments

Ok so this was a bit tricky but I knew it would work and this is not for everyone out there. Remember this is a subdomain and I got a wildcart SSL from GoDaddy (look up my instructions for installing a GoDaddy certificate.

I am using Ubuntu 8.10 server for this and not many changes from the standard install. I want to support multiple sites through 443 on the same IP.

Go to /etc/apache2/ports.conf  Here is what I have, your might be a bit different

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
 
NameVirtualHost *:80
Listen 80
 
<IfModule mod_ssl.c>
    # SSL name based virtual hosts are not yet supported, therefore no
    # NameVirtualHost statement here
    NameVirtualHost *:443
    Listen 443
</IfModule>

Then setup the virtual host files just like normal. Here is the open close headers for this

<VirtualHost *:443>
    ....
</VirtualHost>