Apache Web Server and Tomcat directories

Hi there!
I want to compile and install Apache Web Server and Tomcat in openSuse 15.4.
In which directories should I install them? (/opt, /usr, …)
which applications should be installed in /opt, /usr or /usr/local?
Thank you, in advance.

Why compile yourself, just install hem?

I want to compile them because I think in this way I will learn about those servers and gain experience. Also I’ll get more control of these applications.

Hi
I would suggest reviewing the openSUSE Build Service builds… (look at the spec file), there is building (one set of eyes) and there is building (many sets of eyes)…

If your wanting to learn, going forward, look at containers or a virtual machine to play and test with.

Just my very personal ideas.

  1. By compiling products, you will learn about the compiling process (cc, make, etc) more then about the product itself.
  2. As compilation is done by the user in his environment, where to put it after the whole compiling is successful comes only at the end.
  3. Read https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard so you can decide when the time comes where best to put things. Also checking where those packages from the OSS repo install their files may help (but of course you can not have your version installed on the same places where the “normal” ones are put when the “normal” ones are also on the system).

As an illustration I have checked (with YaST > Software > Software Management) which files are installed with the package apache2 (and there are more packages related to it like apach2-doc, …, apache2-util1):

/etc/apache2
/etc/apache2/charset.conv
/etc/apache2/conf.d
/etc/apache2/default-server.conf
/etc/apache2/errors.conf
/etc/apache2/global.conf
/etc/apache2/httpd.conf
/etc/apache2/listen.conf
/etc/apache2/loadmodule.conf
/etc/apache2/magic
/etc/apache2/mime.types
/etc/apache2/mod_autoindex-defaults.conf
/etc/apache2/mod_cgid-timeout.conf
/etc/apache2/mod_info.conf
/etc/apache2/mod_log_config.conf
/etc/apache2/mod_mime-defaults.conf
/etc/apache2/mod_reqtimeout.conf
/etc/apache2/mod_status.conf
/etc/apache2/mod_userdir.conf
/etc/apache2/mod_usertrack.conf
/etc/apache2/protocols.conf
/etc/apache2/server-tuning.conf
/etc/apache2/ssl-global.conf
/etc/apache2/ssl.crl
/etc/apache2/ssl.crl/README.CRL
/etc/apache2/ssl.crt
/etc/apache2/ssl.crt/README.CRT
/etc/apache2/ssl.csr
/etc/apache2/ssl.csr/README.CSR
/etc/apache2/ssl.key
/etc/apache2/ssl.key/README.KEY
/etc/apache2/ssl.prm
/etc/apache2/ssl.prm/README.PRM
/etc/apache2/uid.conf
/etc/apache2/vhosts.d
/etc/apache2/vhosts.d/vhost-ssl.template
/etc/apache2/vhosts.d/vhost.template
/etc/logrotate.d/apache2
/usr/bin/log_server_status
/usr/bin/log_server_status2
/usr/lib/firewalld
/usr/lib/firewalld/services
/usr/lib/firewalld/services/apache2-ssl.xml
/usr/lib/firewalld/services/apache2.xml
/usr/lib/systemd/system/apache2.service
/usr/lib/systemd/system/apache2.target
/usr/lib/systemd/system/apache2@.service
/usr/lib64/apache2
/usr/lib64/apache2-event
/usr/lib64/apache2-prefork
/usr/lib64/apache2-worker
/usr/lib64/apache2/mod_access_compat.so
/usr/lib64/apache2/mod_actions.so
/usr/lib64/apache2/mod_alias.so
/usr/lib64/apache2/mod_allowmethods.so
...............
/usr/lib64/apache2/mod_version.so
/usr/lib64/apache2/mod_vhost_alias.so
/usr/lib64/apache2/mod_watchdog.so
/usr/lib64/apache2/mod_xml2enc.so
/usr/lib64/apache2_MMN
**/usr/sbin/a2disflag
/usr/sbin/a2dismod
/usr/sbin/a2enflag
/usr/sbin/a2enmod
/usr/sbin/apache2-systemd-ask-pass
/usr/sbin/apache2ctl
/usr/sbin/apachectl
/usr/sbin/envvars
/usr/sbin/envvars-std
/usr/sbin/htcacheclean
/usr/sbin/rcapache2
/usr/sbin/start_apache2
/usr/sbin/suexec
/usr/sbin/suexec2**
/usr/share/apache2
/usr/share/apache2/apache-22-24-upgrade
/usr/share/apache2/build
/usr/share/apache2/deprecated-scripts
/usr/share/apache2/deprecated-scripts/find_httpd_includes
/usr/share/apache2/deprecated-scripts/find_mpm
/usr/share/apache2/deprecated-scripts/get_includes
/usr/share/apache2/deprecated-scripts/get_module_list
/usr/share/apache2/deprecated-scripts/load_configuration
/usr/share/apache2/error
/usr/share/apache2/error/HTTP_BAD_GATEWAY.html.var
/usr/share/apache2/error/HTTP_BAD_REQUEST.html.var
/usr/share/apache2/error/HTTP_FORBIDDEN.html.var
/usr/share/apache2/error/HTTP_GONE.html.var
/usr/share/apache2/error/HTTP_INTERNAL_SERVER_ERROR.html.var
/usr/share/apache2/error/HTTP_LENGTH_REQUIRED.html.var
/usr/share/apache2/error/HTTP_METHOD_NOT_ALLOWED.html.var
/usr/share/apache2/error/HTTP_NOT_FOUND.html.var
/usr/share/apache2/error/HTTP_NOT_IMPLEMENTED.html.var
/usr/share/apache2/error/HTTP_PRECONDITION_FAILED.html.var
/usr/share/apache2/error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
/usr/share/apache2/error/HTTP_REQUEST_TIME_OUT.html.var
/usr/share/apache2/error/HTTP_REQUEST_URI_TOO_LARGE.html.var
/usr/share/apache2/error/HTTP_SERVICE_UNAVAILABLE.html.var
/usr/share/apache2/error/HTTP_UNAUTHORIZED.html.var
/usr/share/apache2/error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
/usr/share/apache2/error/HTTP_VARIANT_ALSO_VARIES.html.var
/usr/share/apache2/error/README
/usr/share/apache2/error/contact.html.var
/usr/share/apache2/error/include
/usr/share/apache2/error/include/bottom.html
/usr/share/apache2/error/include/spacer.html
/usr/share/apache2/error/include/top.html
/usr/share/apache2/icons
/usr/share/apache2/icons/README
/usr/share/apache2/icons/README.html
/usr/share/apache2/icons/a.gif
/usr/share/apache2/icons/a.png
/usr/share/apache2/icons/alert.black.gif
/usr/share/apache2/icons/alert.black.png
/usr/share/apache2/icons/alert.red.gif
......
/usr/share/apache2/icons/world2.gif
/usr/share/apache2/icons/world2.png
/usr/share/apache2/icons/xml.png
/usr/share/apache2/script-helpers
/usr/share/apache2/sysconf_addword
/usr/share/doc/packages/apache2
/usr/share/doc/packages/apache2/ABOUT_APACHE
/usr/share/doc/packages/apache2/CHANGES
/usr/share/doc/packages/apache2/INSTALL
/usr/share/doc/packages/apache2/README
/usr/share/doc/packages/apache2/README-access_compat.txt
/usr/share/doc/packages/apache2/README-instances.txt
/usr/share/doc/packages/apache2/README.CHANGES
/usr/share/doc/packages/apache2/README.QUICKSTART
/usr/share/doc/packages/apache2/README.cmake
/usr/share/doc/packages/apache2/README.platforms
/usr/share/doc/packages/apache2/SHA1
/usr/share/doc/packages/apache2/SHA1/README.sha1
/usr/share/doc/packages/apache2/SHA1/convert-sha1.pl
/usr/share/doc/packages/apache2/SHA1/htpasswd-sha1.pl
/usr/share/doc/packages/apache2/SHA1/ldif-sha1.example
/usr/share/doc/packages/apache2/httpd.conf.default
/usr/share/doc/packages/apache2/original
/usr/share/doc/packages/apache2/original/extra
/usr/share/doc/packages/apache2/original/extra/httpd-autoindex.conf
/usr/share/doc/packages/apache2/original/extra/httpd-dav.conf
/usr/share/doc/packages/apache2/original/extra/httpd-default.conf
/usr/share/doc/packages/apache2/original/extra/httpd-info.conf
/usr/share/doc/packages/apache2/original/extra/httpd-languages.conf
/usr/share/doc/packages/apache2/original/extra/httpd-manual.conf
/usr/share/doc/packages/apache2/original/extra/httpd-mpm.conf
/usr/share/doc/packages/apache2/original/extra/httpd-multilang-errordoc.conf
/usr/share/doc/packages/apache2/original/extra/httpd-ssl.conf
/usr/share/doc/packages/apache2/original/extra/httpd-userdir.conf
/usr/share/doc/packages/apache2/original/extra/httpd-vhosts.conf
/usr/share/doc/packages/apache2/original/extra/proxy-html.conf
/usr/share/doc/packages/apache2/original/httpd.conf
/usr/share/doc/packages/apache2/printenv
/usr/share/doc/packages/apache2/robots.txt
/usr/share/doc/packages/apache2/test-cgi
/usr/share/fillup-templates/sysconfig.apache2
/usr/share/licenses/apache2
/usr/share/licenses/apache2/LICENSE
/usr/share/man/man1/apxs.1.gz
/usr/share/man/man1/apxs2.1.gz

So there is much more then just /opt or /usr/local.

OK!
Then, the question is: **Which is the directory where I should install personal use applications?
**I’m software developer and I need to install specific versions of Java, Eclipse, Maven, Squirrel, MySQL Workbench and so on. (Some versions aren’t available on openSuse repositories.)
I’m talking about best practices.
Thank you, very much.

You read the Wikipedia article about the FHS I provided a link to?

Hi
You can put them anywhere you like :wink: I personally use a separate partition called data, run things like vscode (think I had eclipse there at one point).

As a software developer where are they (your developed software) going to reside when deployed, container, docker, real hardware etc?

If some versions are not available in openSUSE repositories, you mean for Leap 15.4, other?

that is a very important question. Also, hardly any professional developer I know still uses local installs of (possibly multiple versions of) development tools. With any centralized CI this is unnecessary and not worth the effort in maintenance. If it has to be local, then set up container stacks mirroring the target stack. Or do it correctly right from the start and use a build service, github actions, azure foo, whatever. This is much more important than contemplating the proper install dest directories. Use official upstream docker images of whatever you need in whatever version and place your compiled app wherever the container expects it to be.

Hi
I’ve switched over to Rancher-Desktop, or spin up a vagrant box. Can use k8s, nerdctl (no docker needed), likewise helm charts would take but a few moments to have apache/tomcat spun up etc.

You’re right!
I beg your pardon.

Never mind.

I do not know what exectly you mean with personal, but when that is for an end-user (developer), in general you can use your own space within your home directory and do not need system directories.

But when it comes to more professional developing, I assume Malcolm has the better hints.