Last active
February 20, 2017 14:00
-
-
Save bijanebrahimi/1e82665510dddae70a15b05a012af3b1 to your computer and use it in GitHub Desktop.
Enable graphviz on gitlab markdown language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ nano /etc/gitlab/gitlab.rb | |
nginx['custom_nginx_config'] = "include /var/opt/gitlab/nginx/conf/webtools.zharfpouyan.net;" | |
$ nano /var/opt/gitlab/nginx/conf/webtools.zharfpouyan.net | |
server { | |
listen *:80; | |
server_name webtools.zharfpouyan.net; | |
access_log /var/log/webtools.zharfpouyan.net.access.log; | |
error_log /var/log/webtools.zharfpouyan.net.error.log; | |
location / { | |
proxy_pass http://127.0.0.1:8090; | |
} | |
} | |
$ apt-get install apache2 libapache2-mod-php5 graphviz | |
$ nano /etc/apache2/ports.conf | |
Listen 8090 | |
$ nano /etc/apache2/sites-enabled/000-default.conf | |
<VirtualHost *:8090> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/webtools.zharfpouyan.net | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
</VirtualHost> | |
$ nano /var/www/webtools.zharfpouyan.net/graphviz/index.php | |
<?php | |
$dot_content = rawurldecode($_SERVER['QUERY_STRING']); | |
$dot_file = tempnam("/tmp", "dot_"); | |
file_put_contents($dot_file, $dot_content); | |
header('Content-type: image/svg+xml'); | |
system("dot -Tsvg ".$dot_file); | |
unlink($dot_file); | |
?> | |
$ nano /etc/hosts | |
192.168.0.40 webtools.zharfpouyan.net | |
 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment