> If I don’t need to “set the ’ServerName’ directive globally” (how?) then 
> that’s ok.

Setting the ServerName directive is one of those Simple/Not Simple junctures 
for modern computer users.

If at any point these steps go further than you want, you can just accept that 
in the background that warning will be logged about not being able to determine 
the server’s domain name.

The Apache webserver has a set of configuration files where all kinds of http 
server features can be added, enabled, disabled, blocked, accepted, and so on. 
Cool, but many opportunities for screwing it up. So the byword is don’t mess 
with things you don’t understand.

The main configuration file is named httpd.conf, and the macOS UNIX-based 
installation puts it and the other config files in a folder named:
  /private/etc/apache2

Unless you’ve modified your Finder, you won’t see this listed anywhere, so use 
the Finder’s Go command (press command-option-G) and type or paste in 
"/private/etc/apache2” (no quotes), and hit Return. That folder will open.

You can open and edit httpd.conf with BBEdit. You will need admin permissions 
to save changes.

Search on “ServerName”.

The ServerName directive is probably commented out (# on the left margin).

For your situation, I think the best idea is:

ServerName 127.0.0.1

You can also include the standard http port:

ServerName 127.0.0.1:80

After saving httpd.conf (really, only change the ServerName directive), go back 
to your Terminal, and type:

  sudo apachectl restart

and then type:

  sudo apachectl -t

If all is well, the latter will reply “OK”.

    — Bruce

_bruce__van_allen__santa_cruz_ca_





> On Feb 17, 2023, at 12:00 AM, Omar KN <[email protected]> wrote:
> 
> This did work!  (It works!)
> 
> First it was not a global server, but not a problem:
> 
> sudo apachectl -t
> 
> AH00558: httpd: Could not reliably determine the server's fully qualified 
> domain name, using i5-1791.local. Set the 'ServerName' directive globally to 
> suppress this message
> Syntax OK
> 
> If I don’t need to “set the ’ServerName’ directive globally” (how?) then 
> that’s ok.
> 
> Now php pages can be previewed, thanks a lot!
> 
> /
> with best regards, Omar KN, Stockholm, Sweden
> 
>> On 17 Feb 2023, at 03:44, Bruce Van Allen <[email protected]> wrote:
>> 
>> Or go Roger one step further:
>> 
>> In Terminal,
>> 
>> # first:
>> sudo apachectl restart
>> 
>> # then test with:
>> sudo apachectl -t
>> 
>> If no errors, then in web browser:
>> 
>> <http://127.0.0.1 <http://127.0.0.1/>>
>> 
>> or 
>> 
>> <http://localhost <http://localhost/>>
>> 
>> 
>> This really has nothing to do with which version of Mac OS/macOS you’re 
>> running.
>> 
>> 
>>    — Bruce
>> 
>> _bruce__van_allen__santa_cruz_ca_
>> 
>> 
>> 
>> 
>> 
>>> On Feb 16, 2023, at 1:33 PM, Roger Moffat <[email protected]> wrote:
>>> 
>>> Open the Terminal and type
>>> 
>>> sudo apachectl restart
>>> 
>>> Enter password when prompted.
>>> 
>>> See if there are any error messages.
>>> 
>>> Try 127.0.0.1 again browser - or simply http://localhost/
>>> 
>>> Roger
>>> 
>>>> On Feb 16, 2023, at 4:26 PM, Omar KN <[email protected]> wrote:
>>>> 
>>>> My OS is too old I'm told. ( macOS: 10.14.6 )
>>>> May have to wait until upgrade…
>>>> 
>>>> The http://127.0.0.1 could not be reached.
>>>> 
>>>> /
>>>> with best regards, Omar KN, Stockholm, Sweden
>>>> 
>>>> On Sunday, 12 February 2023 at 22:54:17 UTC+1 Bruce Van Allen wrote:
>>>> To be clear, macOS still comes ready to serve static and dynamic web 
>>>> pages/apps using Apache. The Mac Server app, now discontinued, isn’t 
>>>> needed. 
>>>> 
>>>> The last few macOS system updates have removed PHP, but it’s easy to 
>>>> install using Homebrew. 
>>>> 
>>>> Many on this list could give you the basic simple instructions for setting 
>>>> up web/http service on your machine - it might already be running (try 
>>>> http://127.0.0.1 <http://127.0.0.1/>). 
>>>> 
>>>> Let us know if that appeals to you. 
>>>> 
>>>>> On Feb 12, 2023, at 12:31 PM, Omar KN <[email protected]> wrote: 
>>>>> 
>>>>> Now (in 2023) when Apple's server app is no longer supported 
>>>> 
>>>> 
>>>> — Bruce 
>>>> 
>>>> _bruce__van_allen__santa_cruz_ca_ 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> This is the BBEdit Talk public discussion group. If you have a feature 
>>>> request or need technical support, please email "[email protected]" 
>>>> rather than posting here. Follow @bbedit on Twitter: 
>>>> <https://twitter.com/bbedit>
>>>> --- 
>>>> You received this message because you are subscribed to the Google Groups 
>>>> "BBEdit Talk" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>>> email to [email protected].
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/bbedit/66faeb42-6373-4f30-8088-c899556b038bn%40googlegroups.com.
>>> 
>>> 
>>> -- 
>>> This is the BBEdit Talk public discussion group. If you have a feature 
>>> request or need technical support, please email "[email protected]" 
>>> rather than posting here. Follow @bbedit on Twitter: 
>>> <https://twitter.com/bbedit>
>>> --- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "BBEdit Talk" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to [email protected].
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/bbedit/A6372BB1-52FF-4E57-99FE-720255F0F624%40gmail.com.
>> 
>> -- 
>> This is the BBEdit Talk public discussion group. If you have a feature 
>> request or need technical support, please email "[email protected]" 
>> rather than posting here. Follow @bbedit on Twitter: 
>> <https://twitter.com/bbedit>
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "BBEdit Talk" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/bbedit/H1BoZXcrGDQ/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/bbedit/45729C30-9F85-4D61-ABF7-46610A1EF1D7%40cruzio.com.
> 
> 
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a feature 
> request or need technical support, please email "[email protected]" 
> rather than posting here. Follow @bbedit on Twitter: 
> <https://twitter.com/bbedit>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/bbedit/E907F633-E996-4A57-9B81-A11324099F1C%40gmail.com.

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/4296BAA5-81EE-4881-90A5-1C9099EEAA52%40cruzio.com.

Reply via email to