corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Apache/PHP Installation


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Apache/PHP Installation
Tom J
Organiser: South Wales
Premium Member


Registered: 8th Sep 03
Location: Bridgend
User status: Offline
10th Nov 12 at 15:38   View User's Profile U2U Member Reply With Quote

Trying to do this on a Windows 7 64 bit and having big problems getting it to work

Tried an msi installer to begin with but didn't seem to be compatible with windows 7

uninstalled Apache and then installed it following these instructions

http://lifeofageekadmin.com/how-install-apache-2-4-php-5-4-and-mysql-5-5-21-on-windows-7/

now when i command prompt:
c:\apache24\bin\httpd -k install

says it is already installed

but now apache wont start at all. any ideas?

[Edited on 10-11-2012 by Tom J]
Rob_Quads
Member

Registered: 29th Mar 01
Location: southampton
User status: Offline
10th Nov 12 at 15:45   View User's Profile U2U Member Reply With Quote

I found using WAMP much easier on windows that installing everything bit by bit. It installs all the bits you need for you.
Dom
Member

Registered: 13th Sep 03
User status: Offline
10th Nov 12 at 16:55   View User's Profile U2U Member Reply With Quote

WAMP/XAMP is your best bet as it'll install the whole *AMP stack (apache, mysql, php; also includes PHPMyAdmin/SQLBuddy) and comes with a nice config/menu setup.
noshua
Member

Registered: 19th Nov 08
User status: Offline
10th Nov 12 at 17:03   View User's Profile U2U Member Reply With Quote

XAMP ftw
Tom J
Organiser: South Wales
Premium Member


Registered: 8th Sep 03
Location: Bridgend
User status: Offline
10th Nov 12 at 17:20   View User's Profile U2U Member Reply With Quote

ok i've installed wamp now and been trying to make it so i can create multiple virtual sites.

added this in my C:\windows\system32\drivers\etc hosts file
127.0.0.1 client1.localhost

changed
Listen 80 to
Listen *:80

added following to httpd.conf file:

# Tells Apache to identify which site by name
NameVirtualHost *:80
# Tells Apache to serve the default WAMP Server page to "localhost"
<VirtualHost 127.0.0.1>
ServerName localhost
DocumentRoot "C:/wamp/www"
</VirtualHost>
# Tells Apache to serve Client 1's pages to "client1.localhost"
# Duplicate and modify this block to add another client
<VirtualHost 127.0.0.1>
# The name to respond to
ServerName client1.localhost
# Folder where the files live
DocumentRoot "C:/wamp/client1"
# A few helpful settings...
<Directory "C:/wamp/client1">
allow from all
order allow,deny
# Enables .htaccess files for this site
AllowOverride All
</Directory>
# Apache will look for these two files, in this order, if no file is specified in the URL
DirectoryIndex index.html index.php
</VirtualHost>

but when i navigate to http://client1.localhost/

i get Forbidden

You don't have permission to access / on this server

think its something to do with order, deny, allow but cant figure it out

[Edited on 10-11-2012 by Tom J]
Tom J
Organiser: South Wales
Premium Member


Registered: 8th Sep 03
Location: Bridgend
User status: Offline
10th Nov 12 at 17:22   View User's Profile U2U Member Reply With Quote

http://localhost still works and directs to the wampserver page
Tom J
Organiser: South Wales
Premium Member


Registered: 8th Sep 03
Location: Bridgend
User status: Offline
10th Nov 12 at 17:32   View User's Profile U2U Member Reply With Quote

error log
[Sat Nov 10 17:31:18.600748 2012] [authz_core:error] [pid 756:tid 792] [client 127.0.0.1:51191] AH01630: client denied by server configuration: C:/wamp/client1/
[Sat Nov 10 17:31:19.159780 2012] [authz_core:error] [pid 756:tid 792] [client 127.0.0.1:51191] AH01630: client denied by server configuration: C:/wamp/client1/favicon.ico
Dom
Member

Registered: 13th Sep 03
User status: Offline
10th Nov 12 at 18:05   View User's Profile U2U Member Reply With Quote

Is that your config or did you use the 'Add Virtual host' option on WAMP? But you should use the VirtualHost.conf that is in WAMP rather than http.conf (if you use http.conf then stick it at the bottom).

Try something like -
code:

Listen 80
NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/wamp/www"
</VirtualHost>

<VirtualHost *:80>
ServerName client1.localhost
DocumentRoot "C:/wamp/client1"
</VirtualHost>



Edit - Virtual host conf is '\wamp\bin\apache\Apache2.2.21\conf\extra\httpd-vhosts.conf', just uncomment the include in 'http.conf'.
Also flush your DNS.

[Edited on 10-11-2012 by Dom]
Dom
Member

Registered: 13th Sep 03
User status: Offline
10th Nov 12 at 18:26   View User's Profile U2U Member Reply With Quote

Actually go with below for your virtual host conf (make sure no other virtual hosts are listed) -
code:

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot "C:/wamp/client1"
ServerName client1.localhost
<Directory "C:/wamp/client1">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>



[Edited on 11-11-2012 by Dom]
Tom J
Organiser: South Wales
Premium Member


Registered: 8th Sep 03
Location: Bridgend
User status: Offline
10th Nov 12 at 18:44   View User's Profile U2U Member Reply With Quote

this is my virtual host conf do i tag that on the end or replace the whole lot


# Virtual Hosts
#
# Required modules: mod_log_config

# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
Dom
Member

Registered: 13th Sep 03
User status: Offline
10th Nov 12 at 20:51   View User's Profile U2U Member Reply With Quote

Remove everything in httpd-vhosts.conf then stick in the new config. Just make sure you uncomment the include within http.conf.
Tom J
Organiser: South Wales
Premium Member


Registered: 8th Sep 03
Location: Bridgend
User status: Offline
10th Nov 12 at 22:01   View User's Profile U2U Member Reply With Quote

did what you said and the whole apache crashed and couldn't restart it and had to reinstall so i've given up on that part for now.

can't even get it working basically with PHP right now as i knocked up a test page with this code on it, and it won't even process that it's just displaying it as the whole code and not processing it

code:

< html >
< head >
< title > PHP Testing< /title >
< /head >
< body > < ?php echo < p > If you see this then we did it right! < /p > ; ? >
< /body >
< /html >




if i make a file in php with this though it will bring all the php info up so it must be working

code:

<?php
phpinfo();
?>



[Edited on 10-11-2012 by Tom J]
ed
Member

Registered: 10th Sep 03
Location: Northampton Drives: Fiat 500/Porsche Boxster
User status: Offline
11th Nov 12 at 09:37   View User's Profile U2U Member Reply With Quote

You've got a load of spaces in your first example. Ditch them as the PHP opening tag is <?php and the closing is ?>.
ed
Member

Registered: 10th Sep 03
Location: Northampton Drives: Fiat 500/Porsche Boxster
User status: Offline
11th Nov 12 at 09:39   View User's Profile U2U Member Reply With Quote

Also, you including inline php in a file with a .html extension? That won't work by default so you need to use the .php extension.

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
windows xp Adam-D Geek Day 27 1426
24th Aug 03 at 19:00
by myke
 
PHP database connection help! Planty02 Geek Day 13 498
10th Sep 06 at 21:51
by Planty02
 
Installing Php on a windows server with Apache Aaron Geek Day 6 172
25th Oct 06 at 04:22
by Ian
 
Orange Corsa Jamie-C General Chat 7 2037
11th Jun 08 at 19:17
by Dav
 
Linux Server xa0s Geek Day 1 222
22nd Nov 09 at 12:53
by PaulW
 

Corsa Sport » Message Board » Off Day » Geek Day » Apache/PHP Installation 28 database queries in 0.0143800 seconds