(07-15-2017, 09:38 AM)ciadmin Wrote: Hmmm - Apache has a public_html or an htdocs folder, but a CI project should go *inside* that, eg. at public_html/myproject or htdocs/myproject. The document root for your website would then be set to "public_html/myproject/public" or "htdocs/myproject/public", either in httpd.conf (if this is the only webapp you are running) or inside extra/httpd-vhosts.conf (if using virtual hosts).
That's what I do
I use vhosts and the one set for john-betong.tk has these settings:
Code:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName john-betong.tk
ServerAlias www.john-betong.tk
DocumentRoot /XXX/YYY/ZZZ/john-betong.tk/public_html
<Directory /XXX/YYY/ZZZ/john-betong.tk/public_html>
Options +FollowSymlinks +MultiViews
AllowOverride all
Require all granted
</Directory>
# Error Logging
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/error-john-betong.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
[br]
file: https:/john-betong.tk/index.php
PHP Code:
<?php
declare( strict_types=1 );
// Location to the Paths config file.
// This should be the only line you need to
// edit in this file.
$pathsPath = '../application/Config/Paths.php';
// Path to the front controller (this file)
define('FCPATH', __DIR__.DIRECTORY_SEPARATOR);
/*
*---------------------------------------------------------------
* BOOTSTRAP THE APPLICATION
*---------------------------------------------------------------
* This process sets up the path constants, loads and registers
* our autoloader, along with Composer's, loads our constants
* and fires up an environment-specific bootstrapping.
*/
// Ensure the current directory is pointing to the front controller's directory
chdir(__DIR__);
// Load our paths config file
require $pathsPath;
$paths = new Config\Paths();
$app = require rtrim($paths->systemDirectory,'/ ').'/bootstrap.php';
/*
*---------------------------------------------------------------
* LAUNCH THE APPLICATION
*---------------------------------------------------------------
* Now that everything is setup, it's time to actually fire
* up the engines and make this app do it's thang.
*/
$app->run();
Is there a security problem with the above setup?
Edit:
>>> either in httpd.conf (if this is the only webapp you are running) or inside extra/httpd-vhosts.conf (if using virtual hosts).
I have 10 sites running and they can all access the
/XXX/YYY/ZZZ/ci2/CodeIgniter4/system/ directory.