luyadev / luya

LUYA is a scalable web framework and content management system with the goal to please developers, clients and users alike.
https://luya.io
MIT License
811 stars 205 forks source link

Installation >> General Setup: Missing $WEBROOT/luya-kickstarter/public_html/admin Directory #1832

Closed DebianJK closed 6 years ago

DebianJK commented 6 years ago

Hello, While following closely with https://luya.io/guide/install to install luyadev/luya-kickstarter:~1.0.3, I can successfully access http://localhost/luya-kickstarter/public_html and get to the home page saying that quote 'You are ready!' But when I click on the |Open administration area|, I get quote 'The requested URL /admin was not found on this server'.

What steps will reproduce the problem?

My environment (Fresh PXE/preseed install): Debian 9.4; apache2 v2.4.25-3+deb9u4 with mod-rewrite; mariadb-server v10.1.26-0+deb9u1;
php7.0 v7.0.30-0+deb9u1; composer v1.2.2-1;

Installation steps: composer global require "fxp/composer-asset-plugin:~1.4" cd /var/www; composer create-project luyadev/luya-kickstarter:~1.0.3 cd /var/www/luya-kickstarter/configs; cp env.php.dist env.php; cd /var/www/luya-kickstarter/configs; cp env-local-db.php.dist env-local-db.php; vi /var/www/luya-kickstarter/configs/env-local-db.php; cd /var/www/luya-kickstarter; ./luya migrate cd /var/www/luya-kickstarter; ./luya import cd /var/www/luya-kickstarter; ./luya admin/setup cd /var/www/luya-kickstarter; ./luya health [result=OK]

What is the expected result?

The directory $WEBROOT//luya-kickstarter/public_html/admin should exist!

What do you get instead? (A Screenshot can help us a lot!)

The following error had occurred (quote):

luya\admin\importers\StorageImporter: key | Value erroe | unable to find a storage folder compare.

And the directory $WEBROOT//luya-kickstarter/public_html/admin is missing http://192.168.72.170/admin Quote:

Not Found The requested URL /admin was not found on this server. Apache/2.4.25 (Debian) Server at 192.168.72.170 Port 80"

LUYA Check ouput (run this script and post the result: luyacheck.php)

Additional infos

Q1. Don't have php7 extension icu! Which deb? Q2. Could mariadb-server be the problem?

| LUYA Version | 1.0.3? | PHP Version | php7.0 v7.0.30-0+deb9u1 | Platform | apache2 v2.4.25-3+deb9u4 with mod-rewrite | Operating system | Debian 9.4;

nadar commented 6 years ago

hi @DebianJK

  1. if migration was installed successfully, it should not be a problem with maria db
  2. Looks like mod_rewrite is not enabled if you get the message from your webserver.
nadar commented 6 years ago

or do you get the message from the application? (Its written in red, parsed by yii)

DebianJK commented 6 years ago

Hi nadar, Thanks! From my 1st post (quote):

apache2 v2.4.25-3+deb9u4 with mod-rewrite; [sic]

had been indeed enabled and I do not get the message from the app written in red. The real issue had been described in the title. That is the Debian 9.4 box is

Missing $WEBROOT/luya-kickstarter/public_html/admin Directory

luya_missing_admin_dir_877

nadar commented 6 years ago

But this screenshots shows to me that the webserver can not process the htaccess informations. There is no "admin" directory in public_html this is done by url rules and the admin module is located in the vendor folder.

  1. What does your config look like?
  2. What does https://gist.github.com/nadar/022f890e064c068e75ce6178cd14a09e return?
  3. Even when mod_rewrite is enabled you have to configure this in your virtual host of apache allowing to override like AllowOverride All - have you done this step?
DebianJK commented 6 years ago

File=/etc/apache2/sites-available/000-default.conf (Entire file) <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/luya-kickstarter/public_html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <\/VirtualHost>

File=/var/www/luya-kickstarter/public_html/.htaccess (installed by luya) Options +FollowSymLinks IndexIgnore / RewriteEngine on SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 # php-fastci support RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # php-fpm support RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php .... http://192.168.72.170/luyacheck.php 1: [in_array('mod_rewrite', apache_get_modules())] true 2: [ini_get('short_open_tag')] '' 3: [ini_get('error_reporting')] '22527' 4: [phpversion()] '7.0.30-0+deb9u1' 5: [php_ini_loaded_file()] '/etc/php/7.0/apache2/php.ini' 6: [php_sapi_name()] 'apache2handler' 7: [isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : unknown] 'Apache/2.4.25 (Debian)'

Regarding your 3. above: Q. Do you mean I need to add to 000-default.conf? <Directory /var/www/luya-kickstarter/public_html> AllowOverride All <\/Directory>

DebianJK commented 6 years ago

Hi, @nadar, Thanks! That was it. Modified file=/etc/apache2/sites-available/000-default.conf as below solved the problem: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/luya-kickstarter/public_html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <\/VirtualHost> <Directory /var/www/luya-kickstarter/public_html> AllowOverride All <\/Directory>

Issue resolved!

nadar commented 6 years ago

Perfect. Enjoy LUYA, hope you like it.

DebianJK commented 6 years ago

Hi, @nadar The pleasure is mine. Many thanks for your help! Yii & Luya are very powerful tools indeed.

delinde commented 4 years ago

Hi @nadar, now, please, can we solve this issue for the server LIGHTTPD / Lighty as well?

We would have to write into the file lighttpd.conf something like this ... $HTTP["host"] == "example.com" { server.document-root = "/var/www/example.com/wwwroot/" url.rewrite-once = ( "^luya-kickstarter/index.php/admin$" => "luya-kickstarter/that/very/target/admin/index.php" ) } ... (if I have understood this correctly) – but what would be that/very/target/admin ?

Another approach – why not do this with a symbolic link like this ln -s that/very/target/admin/index.php admin within the folder luya-kickstarter, so we can invoke it like this: _http://example.com/luya-kickstarter/admin_ ? TIA for a solution!

nadar commented 4 years ago

hi @delinde

Personally i have no experience with LIGHTTPD. As LUYA is built upong Yii Framework, i am sure there are people running the Yii Application on LIGHTTPD.

Regarding the admin, this is not available as "physical" folder, its an url rule pointing to the admin module.

I found that somewhere in the Yii Framework forum, maybe this helps?

$HTTP["host"] == "example.com" {

    server.document-root = "/your/path/www/public_html"

    server.name = "example.com"

    dir-listing.activate = "disable"

    index-file.names = ( "index.php", "index.html" )

url.rewrite-once = (

        "^/(.*)" => "/index.php"

)
}

So maybe i should also ask, what is your problem then? You are not able to open the admin but url rules work? Need more info. maybe create a new issue.