Fórum Ubuntu CZ/SK
Ostatní => Ubuntu Server => Téma založeno: Kukyn 17 Srpna 2011, 16:57:25
-
Ahoj,
včera jsem sprovoznil Apache s MySQL a PHP a dal jsem se do laborování s joomlou. Vše fungovalo až do té doby, než jsem večer vypnul PC. Ráno na mě vybafla tahle hláška.
Zkoušel jsem odinstalovat a znuvu nainstalovat dle wiki a je to pořád to samé. Nejsem moc zkušený na to, abych se mohl v systému vrtat, poradíte mi, prosím, jak na to? :-)
-
bezi apache? zjistis to prikazem
ps -ef|grep apache
Pokud apache pobezi, tzn ve vypisu se ti objevi radky jako root 6327 1 9 19:05 ? 00:00:00 /usr/sbin/apache2 -k start, tak sem pastni soubor /etc/apache2/ports.conf
-
apache běží...
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
NameVirtualHost *:80
Listen 80
<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
-
Kdyz napises
netcat localhost 80
tak co to udela? pokud jen blika kurzor, zkus tam cokoli napsat a stisknout enter
-
netstat -an | egrep 80.*LIST
lsof -i | egrep '(80|http).*LIST'
-
netcat localhost 80
tak co to udela?
Nedělá to naprosto nic. Kurzor jenom bliká. Když něco napíšu, dopadne to takhle:
lukyn@lukyn-laptop:~$ netcat localhost 80
lukyn@lukyn-laptop:~$ l
l: command not found
lukyn@lukyn-laptop:~$
-
Nikdo neví? :-)
-
Co poradil ntz jsi zkousel?
-
Nikdo neví? :-)
Ale ví, jenom se musíš víc snažit.
netcat localhost 80
tak co to udela?
Nedělá to naprosto nic. Kurzor jenom bliká. Když něco napíšu, dopadne to takhle:
lukyn@lukyn-laptop:~$ netcat localhost 80
lukyn@lukyn-laptop:~$ l
l: command not found
lukyn@lukyn-laptop:~$
Na 80ce nic není?
netstat -an | egrep 80.*LIST
lsof -i | egrep '(80|http).*LIST'
Tohle jsi ignoroval proč?
-
netstat -an | egrep 80.*LIST
lsof -i | egrep '(80|http).*LIST'
První příkaz neudělá nic, druhý vypíše následující:
root@lukyn-laptop:~# lsof -i | egrep '(80|http).*LIST'
smbd 682 root 24u IPv6 8090 0t0 TCP *:microsoft-ds (LISTEN)
smbd 682 root 25u IPv6 8092 0t0 TCP *:netbios-ssn (LISTEN)
-
zadnej web server ti nebezi
-
Zkusil jsem všechno odinstalovat a znovu nainstalovat a bez změny.
Takhle se nikam nepohnu. Jediný návod, jak sprovoznit je na wiki. Vše šlapalo, ale pak jako když utne a od té doby nic.
Byl by někdo ochotný napsat seznam úkonů, jak zjistím,kde je chyba? Vím, že jste tady všichni zkušení a vše vám přijde jako samozřejmost. Já jsem ale naprostá lama.
Ještě jednou děkuji. :-)
-
http://forum.ubuntu.cz/index.php/topic,56701.0.html
-
lukyn@lukyn-laptop:~$ sudo apt-get install mysql-server phpmyadmin
Čtu seznamy balíků… Hotovo
Vytvářím strom závislostí
Čtu stavové informace… Hotovo
mysql-server je již nejnovější verze.
Následující balíky byly nainstalovány automaticky a již nejsou potřeba:
ruby1.8-dev librack-ruby rubygems linux-headers-2.6.38-8 krb5-config
xulrunner-2.0 librack-ruby1.8 libdbi0 libopkele3 libapache-ruby1.8 ruby1.8
libbsd-resource-perl libdevel-symdump-perl libtidy-0.99-0 ruby
xulrunner-2.0-mozjs linux-headers-2.6.38-8-generic libneko0 rubygems1.8
libjs-prototype libruby1.8
Pro jejich odstranění použijte „apt-get autoremove“.
Následující extra balíky budou instalovány:
php5-gd php5-mcrypt
Následující NOVÉ balíky budou nainstalovány:
php5-gd php5-mcrypt phpmyadmin
0 aktualizováno, 3 nově instalováno, 0 k odstranění a 10 neaktualizováno.
Potřebuji stáhnout 0 B/4 371 kB archivů.
Po této operaci bude na disku použito dalších 18,1 MB.
Chcete pokračovat [Y/n]? y
Přednastavuji balíky...
Instaluji balík php5-gd.
(Čtu databázi … nyní je nainstalováno 214711 souborů a adresářů.)
Rozbaluji php5-gd (z …/php5-gd_5.3.5-1ubuntu7.2_i386.deb) …
Instaluji balík php5-mcrypt.
Rozbaluji php5-mcrypt (z …/php5-mcrypt_5.3.5-0ubuntu1_i386.deb) …
Instaluji balík phpmyadmin.
Rozbaluji phpmyadmin (z …/phpmyadmin_4%3a3.3.10-1_all.deb) …
Zpracování spouštěčů pro balík libapache2-mod-php5 …
Action 'configtest' failed.
The Apache error log may have more information.
Your apache2 configuration is broken, so we're not restarting it for you.
Zpracování spouštěčů pro balík hicolor-icon-theme …
Zpracování spouštěčů pro balík doc-base …
Processing 1 added doc-base file(s)...
Registering documents with scrollkeeper...
Zpracování spouštěčů pro balík man-db …
Nastavuji balík php5-gd (5.3.5-1ubuntu7.2) …
Nastavuji balík php5-mcrypt (5.3.5-0ubuntu1) …
Nastavuji balík phpmyadmin (4:3.3.10-1) …
dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf
Replacing config file /etc/phpmyadmin/config-db.php with new version
apache2: Syntax error on line 230 of /etc/apache2/apache2.conf: Syntax error on line 14 of /etc/apache2/sites-enabled/default.save: </Vir> directive missing closing '>'
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
invoke-rc.d: initscript apache2, action "reload" failed.
Lighttpd not installed, skipping
lukyn@lukyn-laptop:~$
lukyn@lukyn-laptop:~$ sudo mv /etc/apache2/sites-enabled/default ~/apache2-default.backup
mv: nelze získat informace o „/etc/apache2/sites-enabled/default“: Adresář nebo soubor neexistuje
lukyn@lukyn-laptop:~$
-
A co takhle zkusit číst?
apache2: Syntax error on line 230 of /etc/apache2/apache2.conf: Syntax error on line 14 of /etc/apache2/sites-enabled/default.save: </Vir> directive missing closing '>'
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
Nejde o lamu či nelamu... jasně to píše chybnou syntaxi a ještě to pro pohodlí vypíše číslo řádku... co takhle se podívat co jste mu to tam podstrčil v konfiguraci a poslat výpis sem ... to už se pak radí lépe. A je jasné, že když je špatně konfigurace, tak se daný web server nespustí (toť ostatně platí obecně).
-
Slááááva :-)
Částečně se mi to podařilo rozchodit. Mam takovou radost.
Problém byl v tom, že neexistoval /etc/apache2/sites-enabled/default
/etc/apache2/sites-enabled/default.save vypadal takhle:
<VirtualHost *:80>
ServerName *
ServerAdmin napis@admin.ovi
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domena1.eu
RewriteRule (.*) http://www.domena1.eu$1 [R=301,QSA,L]
RewriteCond %{HTTP_HOST} ^domena2.com
RewriteRule (.*) http://www.domena2.com$1 [R=301,QSA,L]
VirtualDocumentRoot /var/www/%-2.0.%-1.0/%-3
</Virt>
Vytvořil jsem default a skopíroval:
<VirtualHost *:80>
ServerName *
ServerAdmin napis@admin.ovi
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domena1.eu
RewriteRule (.*) http://www.domena1.eu$1 [R=301,QSA,L]
RewriteCond %{HTTP_HOST} ^domena2.com
RewriteRule (.*) http://www.domena2.com$1 [R=301,QSA,L]
VirtualDocumentRoot /var/www/%-2.0.%-1.0/%-3
</VirtualHost>
localhost už jede, dostanu se i na phpmyadmin.
Vytvořil jsem oprávnění složky:
sudo chmod -R 777 /var/www
Bohužel jsem narazil na další problém, ve /var/www
jsem vytvořil složku joomla, a nakopíroval instalační soubory.
Instalaci chci spustit http://localhost/joomla/
ale odpovědí je, že joomla není na serveru
-
No nešlo to, protože to končilo:
</Virt>
ale mělo tam být:
</VirtualHost>
Nevím z hlavy jak se instaluje joomla, ale co to napsalo přesně. Tj. co píše prohlížeč? Chybu 404?
Co je ve složce:
ls /var/www/joomla
PS: a takhle jak je postavený ten default... tak tam vůbec být nemusí... a poběží to na localhostu.
-
No nešlo to, protože to končilo:
</Virt>
ale mělo tam být:
</VirtualHost>
Nevím z hlavy jak se instaluje joomla, ale co to napsalo přesně. Tj. co píše prohlížeč? Chybu 404?
Co je ve složce:
ls /var/www/joomla
PS: a takhle jak je postavený ten default... tak tam vůbec být nemusí... a poběží to na localhostu.
Tak prohlížeč napíše přesně:
The requested URL /joomla/ was not found on this server.
V ls /var/www/joomla
je lukyn@lukyn-laptop:~$ ls /var/www/joomla
administrator htaccess.txt INSTALL.php modules
bbclone CHANGELOG.php language plugins
cache images libraries README_eCommerce.txt
components includes LICENSE.php robots.txt
configuration.php-dist index.php LICENSES.php templates
COPYRIGHT.php index2.php logs tmp
CREDITS.php installation media xmlrpc
podle výpisu tam něco je. Že by něco zakazovalo spustit http://localhost/joomla
-
No jestli DocumentRoot pro localhost leží v /var/www pak 100% když v /var/www/joomla něco je musí naběhnout ten index.php.
Ověřit to třeba lze tak, že si do /var/www uděláte index.html a do něj si dáte nějakou stránku statickou a poté http://localhost musí ukázat tuto zvolenou stránku.
A ten default a default.save bych asi nejspíš smazal... předpokládám, že když přistupujete přes localhost, tak ty přesměrování v tom nastavení nevyužíváte. Samozřejmě si je někde zálohujte než je smažete!!! Po vymazání udělejte restart apache. A poté sem můžete i přilepit obsah souboru /etc/apache/apache.conf (doufám, že to je správně ta cesta).
-
[code][quote author=Martin - ViPEr*CZ* link=topic=57993.msg414521#msg414521 date=1313756836]
No jestli DocumentRoot pro localhost leží v /var/www pak 100% když v /var/www/joomla něco je musí naběhnout ten index.php.
Ověřit to třeba lze tak, že si do /var/www uděláte index.html a do něj si dáte nějakou stránku statickou a poté http://localhost musí ukázat tuto zvolenou stránku.
A ten default a default.save bych asi nejspíš smazal... předpokládám, že když přistupujete přes localhost, tak ty přesměrování v tom nastavení nevyužíváte. Samozřejmě si je někde zálohujte než je smažete!!! Po vymazání udělejte restart apache. A poté sem můžete i přilepit obsah souboru /etc/apache/apache.conf (doufám, že to je správně ta cesta).
[/quote]
Když jsem smazal default v
/etc/apache2/sites-enabled/default[/code] při restartování apace2 to napsalo: lukyn@lukyn-laptop:~$ sudo /etc/init.d/apache2 force-reload
[sudo] password for lukyn:
* Reloading web server config apache2 [Fri Aug 19 15:28:30 2011] [warn] NameVirtualHost *:80 has no VirtualHosts
[ OK ]
Když jsem tam default vrátil: lukyn@lukyn-laptop:~$ sudo /etc/init.d/apache2 force-reload
* Reloading web server config apache2 [ OK ]
/etc/apache2/apache2.conf
vypadá následně:
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# The configuration directives are grouped into three basic sections:
# 1. Directives that control the operation of the Apache server process as a
# whole (the 'global environment').
# 2. Directives that define the parameters of the 'main' or 'default' server,
# which responds to requests that aren't handled by a virtual host.
# These directives also provide default values for the settings
# of all virtual hosts.
# 3. Settings for virtual hosts, which allow Web requests to be sent to
# different IP addresses or hostnames and have them handled by the
# same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "foo.log"
# with ServerRoot set to "/etc/apache2" will be interpreted by the
# server as "/etc/apache2/foo.log".
#
### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation (available
# at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"
#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
LockFile ${APACHE_LOCK_DIR}/accept.lock
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15
##
## Server-Pool Size Regulation (MPM specific)
##
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
# worker MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
# graceful restart. ThreadLimit can only be changed by stopping
# and starting Apache.
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
# event MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_event_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy all
</Files>
#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain
#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log
#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn
# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf
# Include all the user configurations:
Include httpd.conf
# Include ports listing
Include ports.conf
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.
# Include generic snippets of statements
Include conf.d/
# Include the virtual host configurations:
Include sites-enabled/
-
Toto
[Fri Aug 19 15:28:30 2011] [warn] NameVirtualHost *:80 has no VirtualHosts
To je jen warning... říká, že nemáte pro NameVirtualHost *:80 definováný žádný virtualhost. Což ovšem ničemu nevadí pokud to máte jen pro localhost. Pravděpodobně v ports.conf nebo httpd.conf by stačilo directivu zakomentovat, ale i tak to na běh apache nemá vliv.
Takže stále trvám na odebrání. A do apache.conf si vložte
DocumentRoot /var/www
-
do apache.conf si vložte
DocumentRoot /var/www
Tak vloženo a výsledek pořád stejný:
The requested URL /joomla/ was not found on this server.
Apache/2.2.17 (Ubuntu) Server at localhost Port 80
-
Udělal jsem ještě výpis /var/www
ls -l /var/www
lukyn@lukyn-laptop:~$ ls -l /var/www
celkem 4
drwxrwxrwx 18 lukyn lukyn 4096 2011-08-19 12:25 joomla
lrwxrwxrwx 1 lukyn root 21 2011-08-19 10:09 phpmyadmin -> /usr/share/phpmyadmin
Zajímavé je, že phpmyadmin normálně spustim.
Oprávnění je na složku /var/ww/joomla
sudo chmod -R 777 /var/www/joomla
-
Složku joomla jsem zkopíroval do usr/share a světe div se, ono se to rozjelo. Poradíte mi, prosím, ještě, kde předělám jako domovskou složku (asi DocumentRoot. Děkuji.