Hi everyone,
first-time post here
I’ve developed a small application on my windows host, and it’s working fine. Login, webcrawler, navigation, everything is working as expected (including pretty URLs).
Therefore, I’ve bought a raspberry pi3 to run my application within my local network. This is the setup:
- mysql: Server version: 10.1.23-MariaDB-9+deb9u1 Raspbian 9.0
- apache: Server version: Apache/2.4.25 (Raspbian)
- php: PHP 7.0.30-0+deb9u1 (cli)
So I’ve copied my yii-basic (called yii) folder to /var/www/html, so I would expect to access it with http://[ip of my raspb]/yii .
That didn’t work, so I tried http://[ip of my raspb]/yii/web . That worked, but only for the index-page. As soon as I clicked a link, I got an 404 response.
So I googled and tried different stuff, until I changed
/etc/apache2/sites-enabled/000-default.conf
to the following settings:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName www.virtualdomain.local
DocumentRoot "/var/www/html/yii/web"
<Directory "/var/www/html/yii/web">
# use mod_rewrite for pretty URL support
RewriteEngine on
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
# use index.php as index file
DirectoryIndex index.php
# ...other settings...
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Then I’ve restarted the apache server and called http://[ip of my raspb]/ and yii was fully available, including links, actions etc.
Problem:
Within /var/www/html/ I’d like to have other web applications run as well. And with my current settings, I cant reach them.
Final Question therefore:
How do I have to configure the apache, so that I can reach my yii-mb application with http://[ip of my raspb]/yii/ ?
Thanks for your help in advance,
flixbox
Edit: I don’t think that’s a right problem. Im updating my application via “git checkout” and automatically run
sudo chmod -R 770 /var/www/html/yii/
sudo chown -R pi:www-data /var/www/html/yii/
after it.