diff --git a/install.sh b/install.sh index c77641528022d81db048f7320ea9010a7c1d73a9..d5cd05a9227d9725dd82f017ccc6d8c1b7a64276 100755 --- a/install.sh +++ b/install.sh @@ -11,7 +11,8 @@ mysql_user="root" mysql_pass="" sparql_key=$RANDOM -basedir="http://localhost/slodps/" +basedir="http://localhost/" +slodpsdir="slodps" ns=$basedir endpoint="http://localhost/sparql?" everything_ok="n" @@ -19,13 +20,10 @@ everything_ok="n" if [ -e "$parent_htaccess" ] then echo ".htaccess file found in parent directory." - echo "Please remove it or add the content of $root_htaccess in it" + echo "Please remove it to continue the installation." exit fi -echo "WARNING: Copying $root_htaccess as .htacess in parent directory" -echo "" -cp $root_htaccess $parent_htaccess while [ "$everything_ok" != "y" ] do @@ -38,6 +36,16 @@ do then basedir=$aux_basedir fi + + echo -n "From the base directory, where is slodps located? (default '$slodps'): " + read aux_slodpsdir + echo "" + if [ "$aux_slodpsdir" != "" ] + then + slodpsdir=$aux_slodpsdir + fi + + ns=$basedir echo -n "Type the local namespace you will use (default '$ns'): " read aux_ns @@ -47,6 +55,7 @@ do ns=$aux_ns fi + echo -n "What is the URL of your SPARQL endpoint? (default $endpoint): " read aux_endpoint echo "" @@ -108,7 +117,8 @@ do fi echo "==Configuration==" echo "Ok, so I have the following configuration:" - echo "slodps is installed at $basedir" + echo "Base URL is $basedir" + echo "slodps is installed at $basedir$slodpsdir" echo "The local namespace is $ns" echo "Your SPARQL endpoint is located at $endpoint" echo "For slodps internal sparql endpoint the configuration is as follows:" @@ -154,5 +164,11 @@ done ?>" echo "$content" > $settings_file chmod 644 $settings_file - echo "New configuration file created" +echo "" +echo "WARNING: Copying $root_htaccess as .htacess in parent directory" +echo "" +cp $root_htaccess $parent_htaccess +echo 'RewriteRule ^(.+)$ '$slodpsdir'/index.php?q=$1 [L]' >> $parent_htaccess + + diff --git a/root.htaccess b/root.htaccess index 7852a425a6544f52d6304a1dac9c52fe66f9cc35..e86f348861a9ec86de421d2da8898985c2f5efa4 100644 --- a/root.htaccess +++ b/root.htaccess @@ -3,4 +3,4 @@ RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !.*/index.php$ -RewriteRule ^(.+)$ slodps/index.php?q=$1 [L] +