1
Ich habe einen Apache vhost, die ein wenig wie folgt aussieht:einzigartige Domain-Namen extrahieren und die Dokument-Root von Apache vhosts
<VirtualHost *:80>
ServerName aaaaaa.com
ServerAlias www.aaaaaa.com upload.aaaaaa.com publisher.aaaaaa.com
ServerAlias aaaaaa.no upload.aaaaaa.no www.aaaaaa.no publisher.aaaaaa.no
ServerAlias bbbbbb.no www.bbbbbb.no upload.bbbbbb.no publisher.bbbbbb.no
ServerAlias cccccc.live upload.cccccc.live www.cccccc.live publisher.cccccc.live
ServerAlias dddddd.com *.dddddd.com
ServerAlias aaaaaa.cccccc.live *.aaaaaa.cccccc.live
ServerAlias eeeeee.com *.eeeeee.com
ServerAlias ffffff.com *.ffffff.com
ServerAlias aaaaaa-com.bbbbbb.no
ServerAdmin [email protected]
ErrorLog /var/log/apache2/aaaaaa.com-error.log
CustomLog /var/log/apache2/aaaaaa.com-access.log combined
ServerSignature Off
<IfModule mod_php5.c>
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
</IfModule>
DocumentRoot /var/www/html/aaaaaa.com/current/www/
<Directory /var/www/html/aaaaaa.com/current>
AllowOverride all
</Directory>
Alias /oc-publisher-framework /var/www/releases/oc-publisher-framework-www/
# Fake https to become on for Cloudflare special headers.
SetEnvIf X-Forwarded-Proto https HTTPS=on
SetEnvIf CF-Visitor {"scheme":"https"} HTTPS=on
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerName aaaaaa.com
ServerAlias aaaaaa.no
ServerAlias www.aaaaaa.no
ServerAlias bbbbbb.no
ServerAlias www.bbbbbb.no
ServerAlias cccccc.live
ServerAlias www.cccccc.live publisher.cccccc.live
ServerAlias dddddd.com
ServerAlias www.dddddd.com
ServerAlias www.aaaaaa.com
ServerAlias gc-aaaaaa.aaaaaa.com
ServerAlias www.gc-aaaaaa.aaaaaa.com
ServerAlias aaaaaa.cccccc.live
ServerAlias www.aaaaaa.cccccc.live
ServerAlias eeeeee.com www.eeeeee.com
ServerAdmin [email protected]
ErrorLog /var/log/apache2/aaaaaa.com-error.log
CustomLog /var/log/apache2/aaaaaa.com-access.log combined
ServerSignature Off
<IfModule mod_php5.c>
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
</IfModule>
DocumentRoot /var/www/html/aaaaaa.com/current/www/
<Directory /var/www/html/aaaaaa.com/current>
AllowOverride all
</Directory>
Alias /oc-publisher-framework /var/www/html/releases/oc-publisher-framework-www/
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/bbbbbb.no.crt
SSLCertificateKeyFile /etc/apache2/ssl/bbbbbb.no.key.txt
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
</IfModule>
ich die einzigartigen Domain-Namen extrahieren möchte und das Dokument Wurzel von hier so Es würde so etwas ausgeben:
/var/www/html/aaaaaa.com/current/www/ - aaaaaa.com www.aaaaaa.com upload.aaaaaa.com publisher.aaaaaa.com aaaaaa.no upload.aaaaaa.no www.aaaaaa.no publisher.aaaaaa.no bbbbbb.no www.bbbbbb.no upload.bbbbbb.no publisher.bbbbbb.no ...
Wie würde ich dies mit AWK, BASH oder Python erreichen?
alles versucht das? – anubhava
Ja. Ich habe es in BASH gemacht, aber es ist zu hässlich, es zu benutzen und es macht im Wesentlichen mehrere Durchgänge über diese Datei. Ich hoffe zu lernen, wie es effizienter geht. – Bogdan
Wenn Ihre Posted-Input-Eingabe nur ein wenig aussieht wie Ihre echte Eingabe, dann können wir nicht viel tun, um Ihnen bei der Analyse Ihrer realen Eingaben zu helfen. –