Create short name for my directory

Issues related to applications and software problems
Post Reply
pompastic
Posts: 8
Joined: 2021/05/25 22:59:18

Create short name for my directory

Post by pompastic » 2021/05/29 14:20:22

Hello

i got long name for my client area

http://Public-IP:PORT/long-name-clientarea-name

i need to make it short

http://PublicIP:PORT/Client

Regards


OS :Centls7
Servers apache and My sql
Directory /etc/var/html/long-name-clientarea-name

tunk
Posts: 1204
Joined: 2017/02/22 15:08:17

Re: Create short name for my directory

Post by tunk » 2021/05/29 14:55:59

Maybe a symbolic link would work?

pompastic
Posts: 8
Joined: 2021/05/25 22:59:18

Re: Create short name for my directory

Post by pompastic » 2021/05/29 15:05:46

i just try add short name after

DocumentRoot "/var/www/html


Alias /client /var/www/long-name-clientarea-name

DirectoryIndex user.php
Options Includes FollowSymLinks MultiViews
AllowOverride None
order allow,deny
Allow from all

<Directory "/var/www/html">
AllowOverride None
# Allow open access:
Require all granted

</Directory>

Regards

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Create short name for my directory

Post by TrevorH » 2021/05/29 15:57:54

Or just rename the directory to a shorter name?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Create short name for my directory

Post by jlehtone » 2021/05/29 16:07:17

There are two sides on that question.

1. What should/could be done with Apache config. That is not strictly an OS issue. See:
https://httpd.apache.org/docs/2.4/urlma ... cumentroot
https://httpd.apache.org/docs/2.4/mod/m ... html#alias

Those do mention the symbolic links (and that Apache must be told to allow following links).
They also point that aliases are usually outside of DocumentRoot.

The /var/www/long-name-clientarea-name is apparently outside of /var/www/html
(or we see misleading obfuscation).


2a. On the OS/filesystem level one could:
  • Rename (i.e. "move") directories
  • Bind mount /var/www/long-name-clientarea-name at /var/www/html/client
  • Create symbolic link /var/www/html/client to /var/www/long-name-clientarea-name
2b. The httpd-process runs in its own SELinux context. The default DocumentRoot has SELinux context that allows access to httpd-process.
However, arbitrary directories outside of DocumentRoot do not have that context. They must be (re)labeled, or SELimux blocks access.

Post Reply