Apache smart people?Many problems!
Posted by: mn5800@yahoo.com (---.dcdi.net)
Date: April 08, 2006 12:06AM

Ok this is a difficult situation. I am trying to run current Wamp on my pc. I have Windows XP Home. I have purchased my own domain and have an A record pointing to my ip at zoneedit.com. Because my ISP is blocking port 80 I have to redirect to port 8000 which I have set-up at zoneedit.com also. I do not know if this is helping cause the problems I am having or not. When accessing my domain(not localhost) through proxy I can get html fine it is when trying to access cgi script that I get error. The scripts are not mine, they are from an installer so when I install them I have to put in either localhost or my domain, if I put in my domain I get access errors, misconfiguration errors, internal server errors( in browser) and premature end of script header errors when I look in the logs. I do not want to set these scripts up as local host. Or any part of my website. What am I missing? I have Apache listening on 8000 of course but also on 80 which I can access locally. I do not want to pay to have someone else host my website, I have read Apache book front to back. I dont know if I have given enough info. If anyone(kind people pleez, I run in to too many jerks on the other sights!) can help I would appreciate it. This is driving me nuts.
Thanks! Bobbi


Options: ReplyQuote
Re: Apache smart people?Many problems!
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: April 08, 2006 08:17AM

Before you can run Perl scripts, you need to make sure you have the WAMP ACTIVESTATE PERL ADD-ON. This will install Perl on your computer for you and is needed to run Perl scripts.

I do not have all the time needed explain how to setup to use Perl and a domain in step by step instructions, so just follow them.

You now need to do some editing of httpd.conf to make some changes:

Find:
DirectoryIndex index.php index.php3 index.html index.htm index.html.var

Change to:
DirectoryIndex index.php index.php3 index.html index.htm index.html.var index.cgi index.pl

Now find:
#AddHandler cgi-script .cgi

Change to:
AddHandler cgi-script .cgi

Now open up your c:/wamp folder. Create a new folder called users. Now go to the users folder you just made, and create a new folder named www.your-domain.com (remember to use replace your-domain.com part above with your actual domain name, for example, www.google.com) . Now go to the www.your-domain.com folder you just made, and now create two folders, one named logs, the other named public_html

The public_html is where all your webpage, php scripts, cgi scripts, images, and everything else related for your domain website will go. the logs folder is where apache access and error logs for you domain will go.

Now go back to your httpd.conf file, and find this line:
#NameVirtualHost *:80

Change it to this:

NameVirtualHost *:80

#
#### locahost ####
#

<VirtualHost *:80>
ServerAdmin root@localhost
DocumentRoot C:/wamp/www
ServerName localhost
ErrorLog C:/wamp/logs/error.log
CustomLog C:/wamp/logs/access.log common
<Directory "C:/wamp/www">
Options Indexes FollowSymLinks Includes +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

#
#### your-domain.com ####
#

<VirtualHost *:80>
ServerAdmin webmaster@your-domain.com
DocumentRoot C:/wamp/users/www.your-domain.com/public_html
ServerName www.your-domain.com
ServerAlias your-domain.com
ErrorLog C:/wamp/users/www.your-domain.com/logs/error.log
CustomLog C:/wamp/users/www.your-domain.com/logs/access.log common
<Directory "C:/wamp/users/www.your-domain.com/public_html">
Options Indexes FollowSymLinks Includes +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


Remember to replace all instances of your-domain.com from the settings above with your actual domain name.

You now need to login to ZoneEdit and create a CNAME record for you domain so people can access your domain using:
http://your-domain.com - AND - http://www.your-domain.com

Use this CNAME record:
Host: www.your-domain.com
Type: CNAME
Value: your-domain.com

Now save the file, and restart apache for the new settings to take effect. Now your site will work with domain name. I have made it so you can use cgi scripts for you domain, and you do not have to use a cgi-bin folder for you cgi scripts, you can run them anywhere in your public_html folder, including folders inside your public_html folder.

Also, not too big of a deal but you should use port 8080, not 8000.

Some Help:

Apache 2.x Manual - Directory Index Directive
[httpd.apache.org]

Apache 2.x Manual - AddHandler Directive
[httpd.apache.org]

Apache 2.x Manual - VirtualHost Directive
[httpd.apache.org]



Post Edited (04-08-06 18:54)

CyberSpatium
----------------------
WAMP Forum Admin

Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.

Options: ReplyQuote
Re: Apache smart people?Many problems!
Posted by: mn5800@yahoo.com (---.dhcp.roch.mn.charter.com)
Date: April 09, 2006 02:43AM

Wow I did not expect all of that help. Ok so I already had active perl. I set up the virtual host, changed the port to 8080, was I suppose to put it in(8080) the virtual host container also, or leave it *80? Well I tried it both ways. I am still getting errors(both ways). Either premature end of script header errors, or misconfiguration errors, connection failed errors. Zoneedit does not give the option of being able to CNAME and Webforward at the same time. If I have to redirect everything to subdomain ww2.domain.com:8080 is this what could be screwing everything up? Is there something I need to be configuring in Apache to support this? Zoneedit are the ones that told me how to set that Webforward up, and I asked them if I needed to change anything in my server config, they said probly not. Also I asked the company who writes the program if anyone else has this problem thinking maybe it is in the script itself and they said no. I also had to go back to port 8000 because for some reason 8080 will not work, my isp probably has that blocked too. I am ready give up. Thank you anyway for your assistance I appreciate it.

Options: ReplyQuote
Re: Apache smart people?Many problems!
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: April 09, 2006 06:38PM

Yes, you need to change all instances of port 80 to port 8080 in my last post. I forgot you where using port 8080 and used the apache default port of 80.

NameVirtualHost *:8080

#
#### locahost ####
#

<VirtualHost *:8080>
ServerAdmin root@localhost
DocumentRoot C:/wamp/www
ServerName localhost
ErrorLog C:/wamp/logs/error.log
CustomLog C:/wamp/logs/access.log common
<Directory "C:/wamp/www">
Options Indexes FollowSymLinks Includes +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

#
#### your-domain.com ####
#

<VirtualHost *:8080>
ServerAdmin webmaster@your-domain.com
DocumentRoot C:/wamp/users/www.your-domain.com/public_html
ServerName www.your-domain.com
ServerAlias your-domain.com
ErrorLog C:/wamp/users/www.your-domain.com/logs/error.log
CustomLog C:/wamp/users/www.your-domain.com/logs/access.log common
<Directory "C:/wamp/users/www.your-domain.com/public_html">
Options Indexes FollowSymLinks Includes +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>



You cannot use WebForwarding. You need to setup DNS records for you domain. Login to ZoneEdit and remove web forwarding for your domain.

Before you can change your DNS settings, you need to know what your IP address is. If you do not know your IP is, use this link:
www.whatismyip.com

Now, after you have removed web forwarding for your domain, go to ZoneEdit and click on the Edit Zone link, and after you click on the link, you will see the Choose Zone screen. Click on domain name you want to edit. Now click on the IP addresses (A) link at the top. Leave the Name field blank, and then enter your IP address in the Numeric IP box, and click on the Add New Record button. You will then see a confirmation screen, click on the top Yes button to include both your-domain.com and www.your-domain.com will have the same IP address.

Now, to access your domain you will need to use:
[www.yourdomain.com] -or- [your-domain.com]

Also, you have to set the correct location to Perl in all your Perl scripts. Open your .pl files, and change the very top line to this:
#!c:/wamp/perl/bin/perl

Save all files edited, and restart apache for the new settings to take effect.

Options: ReplyQuote
Re: Apache smart people?Many problems!
Posted by: mn5800@yahoo.com (---.dhcp.roch.mn.charter.com)
Date: April 10, 2006 12:58AM

I always had/have A records set up for my domain. Zoneedit told me the only way to run a webserver when an ISP is blocking port 80 is to set up webforwarding. That is what they told me, I figured they would know better than me. Also the scripts I am trying to use are not mine. They are from precompiled software and they install themselves, there is no option to install them manually or else I would. The tech person says they are not perl scripts. He said they are just plain cgi scripts, whatever that means. I have tried to open the scripts to edit them and they must be encrypted because there are just funny characters in them that are not even on the keyboard. See now I am stuck with some peice of junk software that I cannot even install. When I got the software, my ISP was not blocking 80 so things ran ok, now they are and its all a pain in the rear. I could get them to unblock 80 but they charge an arm and leg for it. Thank you for assistance I will try out what you said and let you know how things work out.

Options: ReplyQuote


Sorry, only registered users may post in this forum.