URL: https://www.overclockers.at/linux/apache2-redirect-index-html-main-php_254993/page_1 - zur Vollversion wechseln!
Hi!
Komme gerade bei meinem Webserver mit Raspian nicht weiter.
Heizungsvisualisierung mit mysql und Apache2 als Webserver.
Bis jetzt: Aufruf der Hompage mit 10.0.0.115 -> kommt auf index.html von der Apache installation. Die index die nach der Installation vorhanden ist.
Aufruf der Homepage der Visualisierung mit 10.0.0.115/p4 komme dann auf die richtige Homepage main.php(10.0.0.115/p4/main.php.
Die benötigte main.php liegt in /var/lib/p4
Wie bringe ich apache bei das er die main.php aus dem Verzeichnis /var/lib/p4 nehmen soll?
.htaccess habe ich angelegt, keine Ahnung aber ob das richtig ist:
any idea?
Umgestrickte Version aus einer Moodle Installation unter Verwendung von Apache2 Virtualhosts:
#Ordner p4 in /var/lib/
#Berechtigungen setzen:
chown -R www-data:www-data /var/lib/p4
chmod -R 755 /var/lib/p4
##Configure Apache Web Server
#If you have a valid domain name which you would like to use to access your Installation, you will need to create a new Apache virtual host for your domain name with the following content:
nano /etc/apache2/sites-available/subdomain.domain.conf (zB. heizung.home.local.conf)
<VirtualHost *:80>
ServerAdmin Administrator@domain (zB. protectedl)
DocumentRoot /var/lib/p4
ServerName domain (zB. ServerName home.local)
ServerAlias subdomain.domain (zB. ServerAlias heizung.home.local)
<Directory /var/lib/p4/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/subdomain.domain-error_log
CustomLog /var/log/apache2/subdomain.domain-access_log common
</VirtualHost>
#Save the file and enable the virtual host with the following command:
a2ensite subdomain.domain.conf (zB. heizung.home.local.conf)
#Once you enable the virtual host, you will need to restart the Apache web server:
service apache2 restart <--- bzw. für die Distro passenden Befehl
##########################################################################
DNS:
Domain <-> IP in die Hosts Datei eintragen für das lokale testen... bzw. in die Hosts Datei der zugreifenden Rechner
mfg
einfacher quick&dirty workaround:
damit erstellst du im /var/www/html aus dem Apache alles holt einfach einen symlink (verknüpfung) zu /var/lib/p4.Code:sudo ln -s /var/lib/p4 /var/www/html/p4
Zitat aus einem Post von UnleashThebeasteinfacher quick&dirty workaround:damit erstellst du im /var/www/html aus dem Apache alles holt einfach einen symlink (verknüpfung) zu /var/lib/p4.Code:sudo ln -s /var/lib/p4 /var/www/html/p4
Sorry, jetzt läufts.
ln -s /var/lib/p4 /var/www/html
davor den html ordner löschen.
Danke
overclockers.at v4.thecommunity
© all rights reserved by overclockers.at 2000-2024