Apache2

Konfiguracja serwerów, usług, itp.
mysterjUs
Posty: 4
Rejestracja: 13 marca 2019, 13:43

Apache2

Post autor: mysterjUs »

Witam wszystkich na forum.
Pytanie dotyczy połączenia instalacji owncloud + vhost. Otóż chciałbym żeby po wpisaniu w przeglądarkę: "IpServera/nazwa" wyświetlał mi się zawartość: "/var/www/html/nazwa".
Problem polega na tym, że jakiś czas temu zainstalowałem owncloud i przy próbie implementacji virtualnych hostów łącznie z owncloud (owncloud.conf, nazwa1.conf, nazwa2.conf itd.) kiedy wpisuję adres serwera ".../owncloud" to loguje się do chmury ale z zupełnie nową bazą danych i strukturą katalogów.

Nigdzie nie mogę znaleźć rozwiązania dlatego proszę o pomoc. Szperałem w sieci, ale doszedłem do miejsca (https://doc.owncloud.com/server/admin_m ... route.html) w którym naszły mnie wątpliwości czy vhosty + owncloud jest wogóle wykonalne. Dzięki za odpowiedź
Awatar użytkownika
LordRuthwen
Moderator
Posty: 2302
Rejestracja: 18 września 2009, 21:45
Lokalizacja: klikash?

Re: Apache2

Post autor: LordRuthwen »

Jest wykonalne. Opisz dokładnie co chcesz zrobić, co zrobiłeś, wraz z konfiguracją oraz pokaż logi.
mysterjUs
Posty: 4
Rejestracja: 13 marca 2019, 13:43

Re: Apache2

Post autor: mysterjUs »

plik 000-deafult.conf:

Kod: Zaznacz cały

<VirtualHost *:80>
	# The ServerName directive sets the request scheme, hostname and port that
	# the server uses to identify itself. This is used when creating
	# redirection URLs. In the context of virtual hosts, the ServerName
	# specifies what hostname must appear in the request's Host: header to
	# match this virtual host. For the default virtual host (this file) this
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.
	#ServerName www.example.com

	ServerAdmin gielas.g@lgmail.com
	DocumentRoot /var/www/html/owncloud

	# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
	# error, crit, alert, emerg.
	# It is also possible to configure the loglevel for particular
	# modules, e.g.
	#LogLevel info ssl:warn

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	# For most configuration files from conf-available/, which are
	# enabled or disabled at a global level, it is possible to
	# include a line for only one particular virtual host. For example the
	# following line enables the CGI configuration for this host only
	# after it has been globally disabled with "a2disconf".
	#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
plik ciesliska.pl.conf:

Kod: Zaznacz cały

<VirtualHost *:80>
	ServerAdmin 	gielas.g@gmail.com
	DocumentRoot 	/var/www/html/ciesliska.pl/public_html
	CustomLog	/var/www/logs/ciesliska.log combined
	ErrorLog 	/var/www/logs/ciesliska.log
	
</VirtualHost>

logi:

Kod: Zaznacz cały

13/Mar/2019:13:02:09 +0100] "GET / HTTP/1.0" 200 3886 "-" "-"
177.65.167.129 - - [13/Mar/2019:13:02:10 +0100] "GET / HTTP/1.0" 200 3886 "-" "-"
177.65.167.129 - - [13/Mar/2019:13:02:13 +0100] "GET / HTTP/1.0" 200 3886 "-" "-"
177.65.167.129 - - [13/Mar/2019:13:02:23 +0100] "GET / HTTP/1.0" 200 3886 "-" "-"
 - - [13/Mar/2019:13:10:07 +0100] "GET /index.php/apps/files/?dir=/&fileid=3 HTTP/1.1" 200 205 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:10:07 +0100] "GET /favicon.ico HTTP/1.1" 404 509 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:11:11 +0100] "GET /index.php HTTP/1.1" 200 205 "http://31.186.198.150/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:11:11 +0100] "GET /favicon.ico HTTP/1.1" 404 509 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:11:17 +0100] "GET /index.html HTTP/1.1" 200 2184 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:11:17 +0100] "GET /master.css HTTP/1.1" 200 310 "http://31.186.198.150/index.html" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:11:17 +0100] "GET /favicon.ico HTTP/1.1" 404 509 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:12:02 +0100] "GET /index.html HTTP/1.1" 200 2184 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:12:02 +0100] "GET /master.css HTTP/1.1" 200 311 "http://31.186.198.150/index.html" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:12:02 +0100] "GET /favicon.ico HTTP/1.1" 404 509 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:12:06 +0100] "GET /index.php HTTP/1.1" 200 204 "http://31.186.198.150/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:12:06 +0100] "GET /favicon.ico HTTP/1.1" 404 509 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:12:45 +0100] "GET /index.php/apps/files/?dir=/&fileid=3 HTTP/1.1" 200 205 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:12:45 +0100] "GET /favicon.ico HTTP/1.1" 404 509 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:12:54 +0100] "GET /owncloud/ HTTP/1.1" 200 2671 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:12:55 +0100] "GET /owncloud/index.php/core/js/oc.js?v=259c022bf3745a6a2fb2b7c39872d357 HTTP/1.1" 200 2464 "http://31.186.198.150/owncloud/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:12:55 +0100] "POST /owncloud/index.php/core/ajax/translations.php HTTP/1.1" 200 16005 "http://31.186.198.150/owncloud/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:12:55 +0100] "GET /owncloud/core/fonts/OpenSans-Regular.woff HTTP/1.1" 200 20846 "http://31.186.198.150/owncloud/core/css/fonts.css?v=259c022bf3745a6a2fb2b7c39872d357" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:12:55 +0100] "GET /owncloud/core/img/logo.svg HTTP/1.1" 200 5343 "http://31.186.198.150/owncloud/core/css/header.css?v=259c022bf3745a6a2fb2b7c39872d357" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:12:55 +0100] "POST /owncloud/index.php/core/ajax/translations.php HTTP/1.1" 200 17125 "http://31.186.198.150/owncloud/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:13:12:55 +0100] "GET /owncloud/cron.php HTTP/1.1" 200 657 "http://31.186.198.150/owncloud/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:21:12 +0100] "GET /index.html HTTP/1.1" 200 2184 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:21:12 +0100] "GET /master.css HTTP/1.1" 200 311 "http://31.186.198.150/index.html" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:21:25 +0100] "GET /ciesliska.pl/ HTTP/1.1" 404 512 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:21:32 +0100] "GET /owncloud/ HTTP/1.1" 404 508 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:21:32 +0100] "GET /favicon.ico HTTP/1.1" 404 509 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:21:40 +0100] "GET /owncloud/ HTTP/1.1" 404 508 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:21:40 +0100] "GET /favicon.ico HTTP/1.1" 404 510 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:21:51 +0100] "GET /html/owncloud/ HTTP/1.1" 404 513 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:22:15 +0100] "GET /www/html HTTP/1.1" 404 507 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:22:22 +0100] "GET /www/html/owncloud HTTP/1.1" 404 516 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:22:29 +0100] "GET /var/www/html/owncloud HTTP/1.1" 404 520 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:22:40 +0100] "GET /var/www/index.php HTTP/1.1" 404 516 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:22:40 +0100] "GET /favicon.ico HTTP/1.1" 404 509 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:22:48 +0100] "GET /ciesliska.pl/ HTTP/1.1" 404 512 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:28:36 +0100] "GET / HTTP/1.1" 200 2128 "-" "Z"
[Wed Mar 13 23:33:43.724821 2019] [:error] [pid 10986] [client 31.186.198.150:53168] script '/var/www/html/ciesliska.pl/public_html/index.php' not found or unable to stat, referer: http://31.186.198.150/
- - [13/Mar/2019:23:33:43 +0100] "GET /index.php HTTP/1.1" 404 508 "http://31.186.198.150/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:33:49 +0100] "GET /ciesliska.pl/ HTTP/1.1" 404 512 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:34:27 +0100] "GET /owncloud/ HTTP/1.1" 404 508 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:35:07 +0100] "GET /owncloud/ HTTP/1.1" 404 508 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
- - [13/Mar/2019:23:35:10 +0100] "GET /owncloud/ HTTP/1.1" 404 507 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
[Wed Mar 13 23:35:17.021575 2019] [:error] [pid 11074] [client 31.186.198.150:53178] script '/var/www/html/ciesliska.pl/public_html/index.php' not found or unable to stat, referer: http://31.186.198.150/
- - [13/Mar/2019:23:35:17 +0100] "GET /index.php HTTP/1.1" 404 508 "http://31.186.198.150/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"
Zrobiłem plik owncloud.conf który jest kopią pliku 000-default.conf. W sytuacji kiedy włączam strony poleceniem a2ensite uprzednio wyłączając 000-default.conf owncloud albo przestawał wczytywać cokolwiek tzn pusta strona się pojawiała albo działał pod adresem serwerIp/owncloud ale wtedy chmura prosiła o stworzenie nowego użytkownika i po jego utworzeniu wyglądało jakby całkiem nowa instancja się utworzyła.

Dzięki za pomoc
mysterjUs
Posty: 4
Rejestracja: 13 marca 2019, 13:43

Re: Apache2

Post autor: mysterjUs »

Przy zmianie portu z 80 na inny wpisując ip serwera wszystko działa. Tzn. owncloud ustawiony na porcie :80 działa po wpisaniu ip serwera natomiast druga strona po wpisaniu ipserwera:1010 tez się otwiera.

Chciałbym natomiast aby te dwie instancje działały na porcie :80.

Owncloud: ipSerwera/owncloud
Strona: ipSerwera/strona.pl

Dzięki
Awatar użytkownika
LordRuthwen
Moderator
Posty: 2302
Rejestracja: 18 września 2009, 21:45
Lokalizacja: klikash?

Re: Apache2

Post autor: LordRuthwen »

Jak definiujesz vityualhosty to podawaj parametry servername i/lub serveralias bo niby skąd apache ma wiedzieć co chcesz wyświetlić?
Przeczytaj: https://www.rosehosting.com/blog/how-to ... -debian-9/
mysterjUs
Posty: 4
Rejestracja: 13 marca 2019, 13:43

Re: Apache2

Post autor: mysterjUs »

Rozwiązanie okazało się banalne
Żeby odwoływać się do kolejnych subdomen ipSerwera/strona sam virtualhost musi wyglądać:

Kod: Zaznacz cały

<VirtualHost ipSerwera/stronaWWW>
         ..
         ..
         ..
</VirtualHost>
Najciemniej pod latarnią. Dzięki za naprowadzenie na rozwiązanie :)
Zablokowany