Welcome Guest, Not a member yet? Register   Sign In
Installation on XAMPP server
#1

[eluser]Unknown[/eluser]
I am new to CI and trying to get it going on my XAMPP server on a Windows XP machine.
Apache and MySQL are running as expected.

It was unclear to me where to put CodeIgniter.
At present it is located at F:\xampp\htdocs\codeigniter.

Based on some info I found in the forum, I put folders for the website, www.CIDemo.com, in a separate application folder, F:\xampp\htdocs\codeigniter\system\application\CIDemo.
I copied the config, controller, etc. folders under the application folder.

My goal is to have separate folders for each CI website.
I also have set my hosts file so that the website URL is 127.0.0.1 www.CIDemo.com localhost

In the config file I have $config['base_url'] = "http://www.CIDemo.com/";
I also have a folder for the website at F:\www\www.CIDemo.com.

Should I put the codeigniter files there? My instincts are that the index.php and config.php files go there

This question arose because when I launched http://www.cidemo.com the "Welcome to XAMPP" window appeared.

Thanks
#2

[eluser]michalsn[/eluser]
Ok, quick example. You have two apps: "first" and "second" placed in application folder
1. Create vhosts in "C:\xampp\apache\conf\extra\httpd-vhosts.conf", for example:
Code:
<VirtualHost *:80>
    ServerName localhost
    DocumentRoot "c:/xampp/htdocs"
    <Directory "c:/xampp/htdocs">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride None
        Order Allow,Deny
        Allow From All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName first
    DocumentRoot "c:/xampp/htdocs/ci171"
    <Directory "c:/xampp/htdocs/ci171">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride None
        Order Allow,Deny
        Allow From All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName second
    DocumentRoot "c:/xampp/htdocs/ci171"
    <Directory "c:/xampp/htdocs/ci171">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride None
        Order Allow,Deny
        Allow From All
    </Directory>
</VirtualHost>
2. Edit your windows hosts file in "C:\WINDOWS\system32\drivers\etc", for example:
Code:
127.0.0.1       localhost
127.0.0.1       first
127.0.0.1       second
3. Edit index.php file in your codeigniter directory, and change variable "application_folder", for example:
Code:
if($_SERVER['HTTP_HOST'] == 'first')
   $application_folder = "application/first";
elseif($_SERVER['HTTP_HOST'] == 'second')
   $application_folder = "application/second";

Perhaps there are better ways, but it was the first idea which came to my mind.
#3

[eluser]drewbee[/eluser]
I actually did it based on port, so I do not have to do all of that...

in httpd.config

Code:
<VirtualHost localhost:80>
    ServerName localhost
    DocumentRoot "c:/xampp/htdocs"
</VirtualHost>

<VirtualHost localhost:81>
    ServerName localhost:81
    DocumentRoot "c:/xampp/htdocs/site_1"
</VirtualHost>


<VirtualHost localhost:82>
    ServerName localhost:82
    DocumentRoot "c:/xampp/htdocs/site_2"
</VirtualHost>

<VirtualHost localhost:83>
    ServerName localhost:83
    DocumentRoot "c:/xampp/htdocs/site_3"
</VirtualHost>

etc etc... I have completely different CI installations for each site, as the site_# is assumed to be the site root by the server.
#4

[eluser]Daniel Moore[/eluser]
I think you'll find the heavily documented .htaccess file the following link helpful:
http://www.danielwmoore.com/remove_index...odeigniter

Also, read on what to do to your config.php file as well, also on that page.




Theme © iAndrew 2016 - Forum software by © MyBB