User Tools

Site Tools


cern:website

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
cern:website [2023/09/29 17:29] – [Personal CERN website] iwncern:website [2024/08/21 15:43] (current) – removed iwn
Line 1: Line 1:
- ======= Personal CERN website ======= 
  
-You can make a personal website to share documents in your EOS directory via the World Wide Web. Please follow the instructions on [[https://cernbox-manual.web.cern.ch/cernbox-manual/en/web/|this page]]. 
- 
-The steps are basically: 
-  - Create a ''/eos/user/${USER::1}/$USER/www'' directory on EOS (''lxplus''). 
-  - Promote it to a website via CERNBox and CERN Web services. 
-  - Configure access with ''.htaccess''. 
-  - Configure each webpage with an index file (''index.html'' or ''index.php''). 
-  - Add content. 
- 
- 
-===== Setup ===== 
- 
-==== Setup access ==== 
- 
-You need to configure access to CMS members as described [[https://espace.cern.ch/webservices-help/websitemanagement/ConfiguringAFSSites/Pages/AccesscontrolonAFSsites.aspx|here]] with an Apache ''[[https://httpd.apache.org/docs/2.4/howto/htaccess.html|.htaccess]]'' file in you ''www'' folder: 
-<file bash .htaccess> 
-SSLRequireSSL # The modules only work using HTTPS 
- 
-AuthType openid-connect 
-  Require valid-user 
-AuthType openid-connect 
-Require claim cern_roles:view-site-root 
- 
-Options +Indexes 
-</file> 
- 
-Other AD FS groups can be found in CERN's [[https://e-groups.cern.ch/e-groups/EgroupsSearch.do|E-groups]]. 
- 
-==== Setup index ==== 
- 
-If you want to display documents and directories in a custom style (in particular plots), you can add an ''index.html'' or ''index.php'' file, for example [[cern:index|this one]]. 
- 
-<wrap tip>Pro tip</wrap> Add the following line in your ''.htaccess'' if you want to have one default index file for all subdirectories: 
-<code bash> 
-DirectoryIndex index.html index.php /<user>/index.php 
-</code> 
-If someone opens your link to some directory, the browser will first look for a ''index.html'' file in that directory, otherwise for ''index.php''. If it does not find any of those, it will look for ''index.php'' in your root ''/<user>/'' directory (which corresponds to your ''www'' directory on ''/eos''). If your ''php'' files needs to access local files, you might need to change the working directory by adding the following line at the beginning of you file: 
-<code> 
-<?php 
-$pwd = preg_replace("|^\/((\w)\w+)\/|","/eos/user/$2/$1/www/",$_SERVER["REQUEST_URI"]); 
-$pwd = preg_replace("(\?.*)","",$pwd); 
-chdir($pwd); 
-?> 
-</code> 
- 
-<wrap tip>Pro tip</wrap> You can set the way the certain files types are opened by adding the following lines to your ''.htaccess'' file: 
-<code> 
-<Files *.log> 
-  ForceType text/plain 
-  Header set Content-Type "text/plain" 
-</Files> 
-</code> 
-In this way ''.log'' files accessible on your website will be opened as a plain ASCII text file in the browser, instead of being downloaded. More content types ("MIME types") can be found [[https://www.lifewire.com/file-extensions-and-mime-types-3469109|here]]. To configure multiple extensions in the same way (''?i:'' is for case-insensitivity): 
-<code> 
-<FilesMatch "\.(?i:log|py|sh|tex)$"> 
-  ForceType text/plain 
-  Header set Content-Type "text/plain" 
-</FilesMatch> 
- 
-<Files *.rtf> 
-  ForceType text/rtf 
-  Header set Content-Type "text/rtf" 
-</Files> 
-</code> 
- 
-<wrap tip>Pro tip</wrap> To make a subdirectory public for everyone with the correct link, you can create a new ''.htaccess'' in that directory with the following lines: 
-<file bash .htaccess> 
-SSLRequireSSL # The modules only work using HTTPS 
-Satisfy Any 
-Allow From All 
-Options +Indexes 
-</file> 
- 
- 
-===== Copy to eos ===== 
- 
-EOS is now mounted on PSI T3, so you mount with 
-<code bash> 
-kinit $USER@CERN.CH && eosfusebind -g krb5 $HOME/krb5cc_$UID 
-</code> 
-or (outdated) 
-<code bash> 
-mkdir ~/eos 
-sshfs -o allow_other,reconnect ineuteli@lxplus.cern.ch:/eos/user/${USER::1}/$USER/ ~/eos 
-</code> 
-Make sure not to forget or add anymore trailing ''/''. 
-With each new session, you can remount using 
-<code bash> 
-fusermount -u ~/eos 
-</code> 
-<wrap tip>Pro tip</wrap> You can put this alias in your ''.bashrc'': 
-<code bash> 
-alias meos='fusermount -u ~/eos && sshfs -o allow_other,reconnect $USER@lxplus.cern.ch:/eos/user/${USER::1}/$USER/ ~/eos && echo "~/eos" && lt ~/eos' 
-</code> 
- 
-Alternatively, use secure copy ''scp'' to copy stuff from your local computer or from PSI T3 to your ''/eos'': 
-<code bash> 
-scp test.txt <user>@lxplus.cern.ch:/eos/user/<letter>/<user>/www/ 
-</code> 
- 
-It is also possible to mount your personal ''/eos'' directory to your local computer with an [[https://cernbox.cern.ch/cernbox/doc/clients.html|CERN Box desktop app]] ([[https://cds.cern.ch/record/2288368|video tutorial]]). 
cern/website.1696001373.txt.gz · Last modified: 2023/09/29 17:29 by iwn