Server nicht erreichbar

M

mod24

Neues Mitglied
Thread Starter
Dabei seit
19.04.2013
Beiträge
10
Reaktionspunkte
0
Hallo MacUser.de Forum,

ich möchte mit dem APACHE 2.2 Dienst unter Mac OS X 10.8 arbeiten. Ich habe per Terminal 'sudo apachectl start' (org.apache.httpd: Already loaded) gestartet. In der http.conf habe ich ServerName auf meine IP-Adresse 192.168.178.22:80 gelegt und mit dem Löschen von # aktiviert. Ebenfalls ist die Internetfreigabe in den Systemeinstellungen aktiviert. Im Router habe ich Port 80 und 443 für 192.168.178.22 aktiviert. Per 'sudo apachectl restart' habe ich APACHE immer neu gestartet. Doch jedes Mal wenn ich 192.168.178.22 in das Safari Adressfeld eingetrage und aktiviere, erscheint die Meldung nach derer keine Verbindung aufgebaut werden kann.

Wo kann der Fehler noch liegen?
 
Und welche IP hat der Rechner, von dem aus Du auf den Server zugreifen willst?
 
hi, ich möchte meinen eigenes macbook ddosen ;-) Also die selbe IP. gruß, mod24
 
Es gibt keine 2 Rechner im selben Netzwerk mit der selben IP.
 
Der Server ist auf dem MacBook, also immer der selbe Rechner - über 'localhost' ist der Host ebenfalls nicht erreichbar. Ich verwende nicht den OS X Server, sondern möchte Apache direkt ohne GUI betreiben. ich habe ebenfalls mal die Firewall deaktiviert - ebenfalls keine Verbindung. ich habe mir von http://clickontyler.com/blog/2012/02/web-sharing-mountain-lion/ mal die Websharing App für Mountain Lion installiert. Ich habe da mal auf ON gedrückt, bloß die Leuchten PHP & Websharing bleiben aus. Die Anwendung verlangt das Nutzerpasswort zum ON bzw. OFF schalten
 
Zuletzt bearbeitet:
kommst Du mit 127.0.0.1 auf den Server? Das wäre der normale localhost.
 
nein - es erscheint mir als wäre der server überhaupt nicht aktiv.
Das meldet die Konsole:

web:~ mod$ sudo apachectl restart
web:~ mod$ sudo apachectl start
org.apache.httpd: Already loaded
 
wieso?
die Meldung sagt doch, daß er schon läuft.
Frag halt mal den Status ab.

Gruß

win2mac
 
> web:~ mod$ sudo apachectl restart
> web:~ mod$ sudo apachectl start
> org.apache.httpd: Already loaded

keine Verbindung

> web:~ mod$ httpd
> (13)Permission denied: make_sock: could not bind to address [::]:80
> (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
> no listening sockets available, shutting down
> Unable to open logs

hm ... keine Verbindung

> web:~ mod$ sudo httpd

hm ... Verbindung

> web:~ mod$ sudo apachectl stop

Verbindung.

> web:~ mod$ sudo httpd -k stop

keine Verbindung ... was zum Teufel ist mit apachectl los ? Es führt https nicht aus!

Ich habe die apachectl mal angehängt:

Code:
[COLOR=#008400][FONT=Menlo]#!/bin/sh[/FONT][/COLOR][COLOR=#008400][FONT=Menlo]#[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# Licensed to the Apache Software Foundation (ASF) under one or more[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# contributor license agreements.  See the NOTICE file distributed with[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# this work for additional information regarding copyright ownership.[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# The ASF licenses this file to You under the Apache License, Version 2.0[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# (the "License"); you may not use this file except in compliance with[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# the License.  You may obtain a copy of the License at[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#[/FONT][/COLOR]
[COLOR=#1337FF][FONT=Menlo][COLOR=#008400]#     [URL="http://www.apache.org/licenses/LICENSE-2.0"][COLOR=#1337ff]http://www.apache.org/licenses/LICENSE-2.0[/COLOR][/URL][/COLOR][/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# Unless required by applicable law or agreed to in writing, software[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# distributed under the License is distributed on an "AS IS" BASIS,[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# See the License for the specific language governing permissions and[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# limitations under the License.[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# Apache control script designed to allow an easy command line interface[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# to controlling Apache.  Written by Marc Slemko, 1997/08/23[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# [/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# The exit codes returned are:[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#   XXX this doc is no longer correct now that the interesting[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#   XXX functions are handled by httpd[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#	0 - operation completed successfully[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#	1 - [/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#	2 - usage error[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#	3 - httpd could not be started[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#	4 - httpd could not be stopped[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#	5 - httpd could not be started during a restart[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#	6 - httpd could not be restarted during a restart[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#	7 - httpd could not be restarted during a graceful restart[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#	8 - configuration syntax error[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# When multiple arguments are given, only the error from the _last_[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# one is reported.  Run "apachectl help" for usage info[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#[/FONT][/COLOR]
[FONT=Menlo]ARGV=[COLOR=#d12f1b]"$@"[/COLOR][/FONT]
[COLOR=#008400][FONT=Menlo]#[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# |||||||||||||||||||| START CONFIGURATION SECTION  ||||||||||||||||||||[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# --------------------                              --------------------[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# [/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# the path to your httpd binary, including options if necessary[/FONT][/COLOR]
[COLOR=#D12F1B][FONT=Menlo][COLOR=#000000]HTTPD=[/COLOR]'/usr/sbin/httpd'[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# pick up any necessary environment variables[/FONT][/COLOR]
[FONT=Menlo][COLOR=#bb2ca2]if[/COLOR] test -f /usr/sbin/envvars; [COLOR=#bb2ca2]then[/COLOR][/FONT]
[FONT=Menlo]  . /usr/sbin/envvars[/FONT]
[COLOR=#BB2CA2][FONT=Menlo]fi[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# a command that outputs a formatted text version of the HTML at the[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# url given on the command line.  Designed for lynx, however other[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# programs may work.  [/FONT][/COLOR]
[COLOR=#D12F1B][FONT=Menlo][COLOR=#000000]LYNX=[/COLOR]"lynx -dump"[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# the URL to your server's mod_status status page.  If you do not[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# have one, then status and fullstatus will not work.[/FONT][/COLOR]
[COLOR=#D12F1B][FONT=Menlo][COLOR=#000000]STATUSURL=[/COLOR]"http://localhost:80/server-status"[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]#[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# Set this variable to a command that increases the maximum[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# number of file descriptors allowed per child process. This is[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# critical for configurations that use many file descriptors,[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# such as mass vhosting, or a multithreaded server.[/FONT][/COLOR]
[FONT=Menlo]ULIMIT_MAX_FILES=[COLOR=#d12f1b]""[/COLOR][/FONT]
[COLOR=#008400][FONT=Menlo]# --------------------                              --------------------[/FONT][/COLOR]
[COLOR=#008400][FONT=Menlo]# ||||||||||||||||||||   END CONFIGURATION SECTION  ||||||||||||||||||||[/FONT][/COLOR]
[FONT=Menlo]
[/FONT]
[COLOR=#D12F1B][FONT=Menlo][COLOR=#000000]LAUNCHCTL=[/COLOR]"/bin/launchctl"[/FONT][/COLOR]
[COLOR=#D12F1B][FONT=Menlo][COLOR=#000000]LAUNCHD_JOB=[/COLOR]"/System/Library/LaunchDaemons/org.apache.httpd.plist"[/FONT][/COLOR]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]run_launchctl() {[/FONT]
[FONT=Menlo]    [COLOR=#bb2ca2]if[/COLOR] [ $UID != [COLOR=#272ad8]0[/COLOR] ]; [COLOR=#bb2ca2]then[/COLOR][/FONT]
[FONT=Menlo]        echo This operation requires root.[/FONT]
[FONT=Menlo]        [COLOR=#bb2ca2]exit[/COLOR] [COLOR=#272ad8]1[/COLOR][/FONT]
[FONT=Menlo]    [COLOR=#bb2ca2]fi[/COLOR][/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]    $LAUNCHCTL $@[/FONT]
[FONT=Menlo]}[/FONT]
[FONT=Menlo]
[/FONT]
[COLOR=#008400][FONT=Menlo]# Set the maximum number of file descriptors allowed per child process.[/FONT][/COLOR]
[COLOR=#D12F1B][FONT=Menlo][COLOR=#bb2ca2]if[/COLOR][COLOR=#000000] [ [/COLOR]"x$ULIMIT_MAX_FILES"[COLOR=#000000] != [/COLOR]"x"[COLOR=#000000] ] ; [/COLOR][COLOR=#bb2ca2]then[/COLOR][/FONT][/COLOR]
[FONT=Menlo]    $ULIMIT_MAX_FILES[/FONT]
[COLOR=#BB2CA2][FONT=Menlo]fi[/FONT][/COLOR]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]ERROR=[COLOR=#272ad8]0[/COLOR][/FONT]
[FONT=Menlo][COLOR=#bb2ca2]if[/COLOR] [ [COLOR=#d12f1b]"x$ARGV"[/COLOR] = [COLOR=#d12f1b]"x"[/COLOR] ] ; [COLOR=#bb2ca2]then[/COLOR] [/FONT]
[FONT=Menlo]    ARGV=[COLOR=#d12f1b]"-h"[/COLOR][/FONT]
[COLOR=#BB2CA2][FONT=Menlo]fi[/FONT][/COLOR]
[FONT=Menlo]
[/FONT]
[FONT=Menlo][COLOR=#bb2ca2]case[/COLOR] $ARGV [COLOR=#bb2ca2]in[/COLOR][/FONT]
[FONT=Menlo]start)[/FONT]
[FONT=Menlo]    run_launchctl load -w $LAUNCHD_JOB[/FONT]
[FONT=Menlo]    ERROR=$?[/FONT]
[FONT=Menlo]    ;;[/FONT]
[FONT=Menlo]stop|graceful-stop)[/FONT]
[FONT=Menlo]    run_launchctl unload -w $LAUNCHD_JOB[/FONT]
[FONT=Menlo]    ERROR=$?[/FONT]
[FONT=Menlo]    ;;[/FONT]
[FONT=Menlo]restart|graceful)[/FONT]
[FONT=Menlo]    run_launchctl unload -w $LAUNCHD_JOB [COLOR=#272ad8]2[/COLOR]> /dev/null[/FONT]
[FONT=Menlo]    run_launchctl load -w $LAUNCHD_JOB[/FONT]
[FONT=Menlo]    ERROR=$?[/FONT]
[FONT=Menlo]    ;;[/FONT]
[FONT=Menlo]startssl|sslstart|start-SSL)[/FONT]
[FONT=Menlo]    echo The startssl option is no longer supported.[/FONT]
[FONT=Menlo]    echo Please edit httpd.conf to include the SSL configuration settings[/FONT]
[FONT=Menlo]    echo and [COLOR=#bb2ca2]then[/COLOR] use [COLOR=#d12f1b]"apachectl start"[/COLOR].[/FONT]
[FONT=Menlo]    ERROR=[COLOR=#272ad8]2[/COLOR][/FONT]
[FONT=Menlo]    ;;[/FONT]
[FONT=Menlo]configtest)[/FONT]
[FONT=Menlo]    $HTTPD -t[/FONT]
[FONT=Menlo]    ERROR=$?[/FONT]
[FONT=Menlo]    ;;[/FONT]
[FONT=Menlo]status|fullstatus)[/FONT]
[FONT=Menlo]    echo Go to $STATUSURL [COLOR=#bb2ca2]in[/COLOR] the web browser of your choice.[/FONT]
[FONT=Menlo]    echo Note that mod_status must be enabled [COLOR=#bb2ca2]for[/COLOR] this to work.[/FONT]
[FONT=Menlo]    ;;[/FONT]
[FONT=Menlo]*)[/FONT]
[FONT=Menlo]    $HTTPD $ARGV[/FONT]
[FONT=Menlo]    ERROR=$?[/FONT]
[COLOR=#BB2CA2][FONT=Menlo]esac[/FONT][/COLOR]
[FONT=Menlo]
[/FONT]
[FONT=Menlo][COLOR=#bb2ca2]exit[/COLOR] $ERROR
[/FONT]
 
Warum nimmst Du nicht einfach MAMP (PRO)???
 
weil ich lernen möchte selber mit apache. etc umgehen zu können. ;-) und das beste ist immer noch - learning by doing
 
keine Verbindung ... was zum Teufel ist mit apachectl los ? Es führt https nicht aus!

Was ist jetzt das Problem? Das du keint https hast?
Den startet apache logischerweise auch nicht per default. Hast du dir schon Zertifikat gebaut? Das ist notwendig für https.
Dann musst du:
Code:
Listen 443
in der apache config eintragen, und natuerlich auch noch nen neuen
Code:
NameVirtualHost *:443
mit passendem DocumentRoot und Pfadangabe zum Zertifikat usw. anlegen.


Und die Fehlermeldung:
make_sock: could not bind to address 0.0.0.0:80 no listening sockets available
heißt, dass der Port schon besetzt ist (oder trivialfall, du bist kein root oder hast die rechte nicht)

Das kannst du checken mit einem
Code:
sudo lsof -i:80
oder
Code:
netstat

Und du kannst natuerlich auch die prozesse durchschauen, ob eine apache schon laeuft mit
Code:
ps

Und nicht so dilettantisch wie du das gemacht hast ;)

Und das nächste mal bitte deine apache _config_ posten. Nicht das startup/startdown skript. Da sollte man nichts dran ändern, und die hat für uns sicherlich keinen Informationsgewinn. -> automatisch/generic erstellt.
 
Von https war eigentlich am Anfang nicht die Rede. Er kam nicht per http drauf, soweit ich ihn verstanden habe. Aber er schreibt etwas 'eigenartig' was er will, macht etc.

Gruß

win2mac
 
Von https war eigentlich am Anfang nicht die Rede. Er kam nicht per http drauf, soweit ich ihn verstanden habe. Aber er schreibt etwas 'eigenartig' was er will, macht etc.

Gruß

win2mac

Okay, sehe ich auch so. Aber was soll dann:
keine Verbindung

> web:~ mod$ httpd
> (13)Permission denied: make_sock: could not bind to address [::]:80
> (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
> no listening sockets available, shutting down
> Unable to open logs

hm ... keine Verbindung

> web:~ mod$ sudo httpd

hm ... Verbindung

> web:~ mod$ sudo apachectl stop

Verbindung.

> web:~ mod$ sudo httpd -k stop

keine Verbindung ... was zum Teufel ist mit apachectl los ? Es führt https nicht aus!

?! Er hat doch verbindung.


An den TS: Einfach nochmal als root apachectl ausführen, und vorher alle Apaches killen. Wenn Fehler ist, in die Apache error log gucken. Da steht alles drin, was man wissen muss.
 
die Kommandos mit apachectl funktionieren jetzt, habe apachectl -k​ process vergessen.
 
weil ich lernen möchte selber mit apache. etc umgehen zu können. ;-) und das beste ist immer noch - learning by doing

:upten:
Dann habe ich nichts gesagt. :)

Es gibt ja auch genug andere Leute, die sich mit Apache einen abkämpfen um dann später mit php/mysql erneut aufs Maul zu fliegen. Wäre php das Ziel, ist mamp immer eine Alternative weil man viel Zeit und nerven spart.
Aber so ... lernen ist immer gut.
 
Wo befindet sich das an Mac OS X gebundene PHP-Verzeichnis?
 
Hängt von der Konfiguration Deines apache ab. :noplan:
 
Zurück
Oben Unten