473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Xampp Drag n drop php sites in htdocs for quick preview

Hi every one,
I'm new to xampp & configuring etc
I've installed, uninstalled,
& again with what looks like a successful install.
http://localhost/phpmyadmin/ apperas to be working
also xampp-control.exe shows

All I want to do is preview
some pre made php websites, I'm not
over interested in learning php code.

the install folder is "C:\xampp"
I've tried to change the
default documentroot "/xampp/htdocs" to "C:\www"

I've dragged and dropped a prebuilt
website I downloaded into
"C:\www" then checked in http://localhost/ only to get

Access forbidden!

You don't have permission to access
the requested directory.
There is either no index document or
the directory is read-protected.

If you think this is a server error, please contact the webmaster.
Error 403
localhost
07/26/08 19:38:24
Apache/2.2.8 (Win32) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_autoindex_color PHP/5.2.5


when configuring the httpd.conf - Is there any importance between
forward & backward slashes? / or \ ?
Are there any other files that need to be configured to
get this to work?(if it is possible at all)

Please - All opinions & thoughts welcomed
Jul 26 '08 #1
3 5955
Is this a common practice? - I mean is it posible to
drag n drop a pre-built php website in to the
htdocs folder and have it 'work' ??
Jul 26 '08 #2
Atli
5,058 Expert 4TB
Hi.

Try giving a complete location to a file that you know exists.
Like say: "http://localhost/index.php"

If that gives you a 403 error, the file permission is probably incorrect.
Which version of Windows are you running?

In any case, try giving "Everybody" total access to the files. If that doesn't solve the problem, it could be a problem with the Apache configuration.
Jul 26 '08 #3
I wouldn't bother trying to move the default xampp htdocs directory, it will probably cause more problems then it's worth. Instead you should create a virtual host. That way you can specify as many hosts as you want and where you want the files to be on the drive.

I have xampp installed in: C:\xampp

And my vhosts are in: C:\home\hostname\public_html

Because on my real server, the linux directory layout is:
/home/hostname/public_html

Where "hostname" is the first eight characters of the actual host name.

"www.somewebsite.com" would have a path like (on bluehost, powweb, etc):
/home/somewebs/public_html/

So I would make a vhost on my drive like:
C:\home\somewebs\public_html\

Open w/ notepad: C:\xampp\apache\conf\httpd.conf

Change:

Expand|Select|Wrap|Line Numbers
  1. # Virtual hosts
  2. Include conf/extra/httpd-vhosts.conf
To:

Expand|Select|Wrap|Line Numbers
  1. # Virtual hosts
  2. Include conf/extra/httpd-vhosts.conf
  3. Include conf/vhosts/*.conf
Now make the folder: C:\xampp\apache\conf\vhosts

Create text file: C:\xampp\apache\conf\vhosts\00.conf
And add this:

Expand|Select|Wrap|Line Numbers
  1. NameVirtualHost *:80
  2. NameVirtualHost *:443
That code will get included first and it will be applied to all the other vhosts.

Using the "www.somewebsite.com" example (/home/somewebs/public_html/):
Create the text file: C:\xampp\apache\conf\vhosts\somewebs.conf
And add this:

Expand|Select|Wrap|Line Numbers
  1. <VirtualHost *:80>
  2.  
  3.     ServerAdmin webmaster@somewebs.com
  4.     ServerName www.somewebs.com
  5.  
  6.     ServerAlias *.somewebs.com
  7.  
  8.     DocumentRoot C:/home/somewebs/public_html
  9.  
  10.     ErrorLog logs/somewebs.com-error_log
  11.     CustomLog logs/somewebs.com-access_log combined
  12.     ScriptAlias /cgi-bin/ "C:/home/somewebs/public_html/cgi-bin/"
  13.  
  14.     <Directory "C:/home/somewebs/public_html/cgi-bin">
  15.         AllowOverride None
  16.         Options +ExecCGI -Includes
  17.         Order allow,deny
  18.         Allow from all
  19.     </Directory>
  20.  
  21.     <IfModule mod_userdir.c>
  22.         UserDir public_html
  23.     </IfModule>
  24.  
  25.     <Directory "C:/home/somewebs/public_html/">
  26.         Options Indexes FollowSymLinks Includes
  27.         AllowOverride All
  28.         Order allow,deny
  29.         Allow from all
  30.     </Directory>
  31.  
  32.  
  33. </VirtualHost>
  34.  
  35. <VirtualHost *:443>
  36.  
  37.     DocumentRoot "C:/home/somewebs/public_html"
  38.     ServerName www.somewebs.com:443
  39.     ServerAdmin webmaster@somewebs.com
  40.  
  41.     ErrorLog logs/somewebs.com-error_log
  42.     CustomLog logs/somewebs.com-ssl_request_log   ssl_combined
  43.     TransferLog logs/somewebs.com-access_log
  44.  
  45.     ScriptAlias /cgi-bin/ "C:/home/somewebs/public_html/cgi-bin/"
  46.  
  47.     SSLEngine on
  48.     SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
  49.     SSLCertificateFile conf/ssl.crt/server.crt
  50.     SSLCertificateKeyFile conf/ssl.key/server.key
  51.  
  52.   <FilesMatch "\.(cgi|shtml|phtml|php|php5|php4|php3?)$">
  53.       SSLOptions +StdEnvVars
  54.   </FilesMatch>
  55.   <Directory "C:/home/somewebs/public_html/cgi-bin">
  56.       SSLOptions +StdEnvVars
  57.   </Directory>
  58.  
  59.     #   SSL Protocol Adjustments:
  60.     SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
  61.  
  62. </VirtualHost>
Open w/ notepad: C:\WINDOWS\system32\drivers\etc\hosts
And below "127.0.0.1 localhost" add:

Expand|Select|Wrap|Line Numbers
  1. 127.0.0.1 www.somewebs.com
  2. 127.0.0.1 somewebs.com
Open: C:\home\somewebs\public_html\
And create an index.html file - and in it put: "Hello World!".

In your browser, go to: www.somewebs.com
And it should say "Hello World!" on a white screen.

So now you have the real site at: www.somewebsite.com
And the virtual site at: www.somewebs.com

------------------------------------------------

To make another vhost, copy "C:\xampp\apache\conf\vhosts\somewebs.conf" to like: C:\xampp\apache\conf\vhosts\tempuser.conf

Open "tempuser.conf" and rename (in this order):
www.somewebs.com to www.tempuser.com
somewebs.com to tempuser.com
somewebs to tempuser

Then add this to the "C:\WINDOWS\system32\drivers\etc\hosts" file:
Expand|Select|Wrap|Line Numbers
  1. 127.0.0.1 www.tempuser.com
  2. 127.0.0.1 tempuser.com
And create (Hello World!): C:/home/tempuser/public_html/index.html

Repeat as necessary.

------------------------------------------------

Now you can drag n drop html sites into the virtual host directory and view them. PHP based site will work too but if they require a database, it will have to be created and populated with phpMyAdmin before you can view the site.
Aug 12 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: scissorhand | last post by:
Is drag and drop feature available in ASP .Net? I am developing a webpage which requires a system administration function. Users in the admin group have to drag user icon to a group icon and assign...
0
by: nicomp | last post by:
I studied the Drag and Drop example that all the .Net dev sites link to: a string is dragged from one list box to another. It all makes sense but it doesn't explain how to determine what the object...
2
by: Grey | last post by:
I need to design a workflow application with C#. I want to design an UI with some workflow components which they can be drag & drop anywhere in order to design the workflow for the application...
0
by: John K | last post by:
I am still pretty new to this environment and don't know much about httpd.conf. I understand that it is the place to configure the server but don't know how to actually use it for what I'm trying...
2
by: dejavue82 | last post by:
Dear ASP.NET programmers, I have noticed many asp.net 2.0 programmers mention that web applications created with the use of Visual Studio wizards and by draging and droping fom the toolbox are...
18
by: Frances | last post by:
I want to learn PHP.. I know JSP, Servlets, have been using Tomcat for 2 years now, and even though I know there are ways you can use PHP in conjunction with Tomcat, I'd rather not tinker with...
3
by: lee9372 | last post by:
Is there a way to change default home page under Xampp, so that when I type http://localhost it would go to a home page other than page with popup asking for Xampp authorization.
0
by: Mathias K. | last post by:
Hello everyone! I just installed Python 2.5 and i want to use Python to build websites. I could load mod_python successfully with Apache but i fail to let the .py-files to be executed! In...
0
by: Bala | last post by:
Hi Experts, I'm using Xampp control for php and i set the smtp configuration in php.ini as SMTP=mail.domainserver.com smtp_port=25 but still i got an error like this.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.