as a small web developer I used Xampp on Windows 8.1 until it crumbled. The prospect to install Windows 10 drove me to Linux. I settled for openSuse Leaf 15.1 and am very happy with the Gnome desktop.
My goal is to run a local webserver to serve local domains for web development like it was on Windows.
After an unpleasant experience with an one-click installtion from the web I used Yast for the webserver.
Host/domainnames must be resolvable to IP addresses, else nobody can find the system. Resolving is done using a combination of /etc/hosts (often for local, on the LAN, available systems) and DNS servers (for everything on the internet).
the name localhost is normaly defined in /etc/hosts as 127.0.0.1, so that can be resolved.
I assume local.domain is defined nowhere. I do not know why you started usng that strange combination. but you could define it also in /etc/hosts (either by editing or using YaST).
You may have to manually setup the Apache configuration – beware, subsequent usage of the YaST module may well overwrite your changes …
Take a look in /etc/apache2/httpd.conf – it points to “*.conf” files located in /etc/apache2/vhosts.d/conf.d/ and, it points to <http://httpd.apache.org/docs/2.4/vhosts/> – there’s a .conf template in /etc/apache2/vhosts.d/.
But, that template is not the same as what things such as Drupal do …
Be aware that, due to the changes YaST makes to the Apache configuration files, you may have to retrieve the “apache2” RPM package and then open it with “ark” to examine the original fully commented Apache configuration files.
BTW, WordPress does something totally different – it doesn’t run as a Virtual Host and, it drops a “wordpress.conf” into /etc/apache2/conf.d/ …
[HR][/HR]As an example of how Virtual Hosts are setup, the ‘drupal8.conf’ located in /etc/apache2/vhosts.d/conf.d/ is as follows:
# Example configuration for a drupal8 repository
#
# As default server
# put the string DRUPAL8 in /etc/sysconfig/apache2 APACHE_SERVER_FLAGS
# to enable the URL
# http://localhost/drupal8
#
# As vhost
# If you want to use drupal8 in one vhost add
# Include /etc/apache2/vhosts.d/conf.d/drupal8.conf
# to the vhost in the vhost.conf file
# put the string DRUPAL8VHOST in /etc/sysconfig/apache2 APACHE_SERVER_FLAGS
# to enable the URL
# http://vhost/drupal8
<IfDefine DRUPAL8VHOST>
# apache can serve the static files directly
Alias /drupal8 "/srv/www/drupal8/"
<Directory /srv/www/drupal8/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
</IfDefine>
As a furthe example, for Typo3 it looks like this:
# Example configuration for a typo3 repository
#
# As default server
# put the string TYPO3 in /etc/sysconfig/apache2 APACHE_SERVER_FLAGS
# to enable the URL
# http://localhost/typo3
#
# As vhost
# If you want to use typo3 in one vhost add
# Include /etc/apache2/vhosts.d/conf.d/typo3.conf
# to the vhost in the vhost.conf file
# put the string TYPO3VHOST in /etc/sysconfig/apache2 APACHE_SERVER_FLAGS
# to enable the URL
# http://vhost/typo3
<IfDefine TYPO3VHOST>
# apache can serve the static files directly
Alias /typo3 "/srv/www/htdocs/"
<Directory /srv/www/htdocs/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
</IfDefine>
It is just a place-holder for real web domain.
Assuming a client wants me to build company.com then I set up **company.local **in my local web environment.
YaST > Network Services > Hostnames. Not very surprising. And then you have to type the same things as when you use your favorite editor. I love YaST, but in this case there is not much gain in using it. In any case, I do not understand why you can not find that.
Although you can set up your Apache manually, I’d probably recommend instead using the YaST http server module, then tinker with the configuration as needed.
It sounds like you need name resolution for your virtual websites for development, and maybe don’t need to serve your websites in your LAN, so configuring entries in your hosts file should be sufficient, it’s nearly exactly the same as the file you configured in your MSWindows
/etc/hosts
Be aware that some complex sub-websites will use an Apache re-write header module to expose a TLD instead of a sub-domain to the User…
On the topic of “domain.local” or “local.domain” my personal SOP is to avoid using any words or phrases that might conceivably be used as a placeholder by technologies… So for instance there is the infamous “.local” namespace used by Avahi. If you have Avahi services running in your LAN, “.local” names can be a problem.
Following the discussion what tld to choose for local domains it seems there’s no solution without advocats against it. I’ve read that .local was owned by M$ and someone pointed at their own documentation where it was implied that it’s ok to use .local for local domains.
The .local top level domain is treated as link-local domain by the resolver. DNS requests are send as multicast DNS requests instead of normal DNS requests.
P.S. I would like to mark the thread as solved. The search gave me a couple of threads for that topic. The answers ranged from “you can’t’” to “edit tags and add solved” which I can not find.
But maybe the title change of this post does the trick.
P.S. I would like to mark the thread as solved. The search gave me a couple of threads for that topic. The answers ranged from “you can’t’” to “edit tags and add solved” which I can not find.
But maybe the title change of this post does the trick.
I don’t agree that setting the $HOSTNAME in YaST (which is accurately also referred to as the Computer Name) should solve your problem… Unless that is the only virtual website you set up. The whole point of identifying websites by their host headers (which is not the same as the $HOSTNAME), you will find the resolution method you’ve configured will not work for additional sites… And, that is the whole point of this configuration, to enable more than one website to share using the same IP address.
You instead need to configure the website properly with its Host Headers, and then provide hostname resolution (note that hostname resolution only refers to the hosts/DNS name resolution system as opposed to NetBIOS name resolution and not specifically $HOSTNAME) by any means. I don’t know where your error is because it could be anything and your current faulty setup would still work… again, only because it’s the first and likely only website on your system.
To minimize your errors, you should or could follow my recommendation… The YaST http-server module will set up your website’s host headers properly so that you should only then need to configure your /etc/hosts file to set up your system correctly. It’s well known that the more handcrafted configuration, the more exposure to error.
The problem won’t affect everyone.
As I noted, it’s a well known problem when running Avahi services on your network which not everyone does.
You can do an Internet search to verify the problem.
If you never run into a problem, that’s OK but in general it’s a problem to be avoided so can’t be recommended… because choosing a proper Domain name in the beginning is the easiest way to fix a problem… Or, you may never have had to go in months or years later and had to change a Domain name. It’s really difficult, particularly if it’s tied into your network security (eg LDAP or AD)… You end up doing deep surgery on the technology no one ever wants to touch voluntarily.